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

News localization #128

Open
bzg opened this issue Nov 4, 2018 · 3 comments
Open

News localization #128

bzg opened this issue Nov 4, 2018 · 3 comments

Comments

@bzg
Copy link

bzg commented Nov 4, 2018

I would like to use News for a french audience. Can someone put me on the right track on how to define i18n variables and use them in the code? Thanks a lot!

@akkartik
Copy link
Member

akkartik commented Nov 4, 2018

I doubt anybody has thought about localization in Arc or Anarki. But maybe somebody here has expertise in that area.

I see now the value of #129 to you. Yes, please feel free to segregate English strings in a separate file so that other languages can get corresponding versions. (Do include the reason at the top.)

@hjek
Copy link
Contributor

hjek commented Nov 4, 2018

I worked a bit on localizing Snap! to Danish. I think they just keep all the English strings in the code, but wrap them in a localize function, e.g. (localize "logout"). Then they have separate for each language, each with a table where the key is the English text and the value is the translation of that in the given language. Fairly simple. Of course every translation needs to be updated when an English string is changed, but that's also just the nature of translations, I guess.

The Arc code would need some modification to handle this though. Take the function link: When passed one string, it uses that string as the href and as the link text, so if you wrap that in localize, as in (link (localize "logout")), the link would point to whatever the translation of "logout" is.

@zck
Copy link
Contributor

zck commented Nov 4, 2018

One thing that could be done was to not treat the argument to localize as the standard English text, but a key to the text. That way the English text can be treated as just one of many translations, and changed without having to change every other translation (which we will forget to do).

Another bonus is that the key can be a little more meaningful; instead of (localize "logout"), we could have (localize 'logout-link-text) or something similar.

@kennethrapp kennethrapp added this to Requested in Arc Forum Updates Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants