Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text direction #91

Open
matheus-rosin opened this issue Jan 4, 2019 · 0 comments
Open

Text direction #91

matheus-rosin opened this issue Jan 4, 2019 · 0 comments

Comments

@matheus-rosin
Copy link

matheus-rosin commented Jan 4, 2019

I think a good new resource would be a new export declaration in languages.js called rtl, which stands for "right to left".

There is a CSS property called direction for setting how to show text in a node, whether from left to right (most languages) or from right to left (just a few ones).

Exporting such a variable would be agreeable for those who want to show a properly styled input, for example (that is what I need right now, reason why I've implemented by myself).

For now, it would be like this:

var rtl = [
  'ar', // arabic
  'iw', // hebrew
  'ps', // pashto
  'fa', // persian
  'sd', // sindhi
  'ur', // urdu
  'yi'  // yiddish
];

And then, a good practice would be export a function for saying if a language is rtl based on its "key":

function isRtl(key) {
  return rtl.includes(key);
}

// isRtl('en') => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant