-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Localization #7
Comments
I haven't considered it, but I would be open to supporting it! We could maintain a set of localizations and create access points for each. // imports tinytime with norwegian localiziations
import tinytime from 'tinytime/no' Or if there's a package that already provides these localizations I'm happy to consider using it, or providing an API to integrate with it. edit providing the API via import paths is actually not a great idea, since it makes dynamic localization trickier. I'm open to providing an API though! |
Adding it as an option seems to be really easy if I'm not missing anything. |
@aweary do you mean then you would store localisations for each language in the one package? Wouldn't that bloat it a bit? How about if you make a separate module for each that only has the localisation table in it? So for example you could do: import tinytime from 'tinytime'
import tinytimeRULocale from 'tinytime-locale-ru'
tinytime.setLocale(tinytimeRULocale) And then you're not having to maintain a package with localisation keys that make up more and more of the size of the module with each new language? |
Have you considered localization? My use case would be just to replace https://github.com/aweary/tinytime/blob/master/src/compiler.js#L29 and https://github.com/aweary/tinytime/blob/master/src/compiler.js#L44 with days/months in norwegian.
Basically just injecting two arrays to keep the code tiny.
The text was updated successfully, but these errors were encountered: