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

Localization Customization #37

Open
groue opened this issue Oct 25, 2016 · 2 comments
Open

Localization Customization #37

groue opened this issue Oct 25, 2016 · 2 comments

Comments

@groue
Copy link
Owner

groue commented Oct 25, 2016

The Localizer filter brings localization to your mustache templates:

let template = ...
template.register(StandardLibrary.Localizer(), forKey: "localize")

It can localize:

  • variables: {{ localize(greeting) }} renders the localization of the greeting variable
  • template snippets: {{# localize }}Hello{{/ localize }} renders the localization of "Hello"
  • embedded variables: {{# localize }}Hello {{name}}{{/ localize }} localizes "Hello %@", and uses the result at a format string in which in injects the rendering of the name variable

As it is today, Localizer uses NSLocalizedString. Two areas of improvements are:

  • Make Localizer extensible so that it can be fueled by another localization engine than NSLocalizedString
  • Make it use a custom locale
@groue
Copy link
Owner Author

groue commented Oct 25, 2016

CC @vadimeisenbergibm since this topic may be of some interest for Kitura

@vadimeisenbergibm
Copy link

@groue Until now we did not receive any localization requirements, so I have no opinion on this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants