Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Localization #59

Merged
merged 25 commits into from
Aug 2, 2014
Merged

Localization #59

merged 25 commits into from
Aug 2, 2014

Conversation

weilu
Copy link
Member

@weilu weilu commented Aug 2, 2014

The call to, and successful implementation of, localization is a super nice excuse to make posts and write about Hive. Let's start this one early as we did with hive-osx.

@weilu weilu added this to the July 2014 milestone Jul 14, 2014
@weilu weilu self-assigned this Jul 21, 2014
@weilu weilu added the WIP label Jul 21, 2014
@weilu
Copy link
Member

weilu commented Jul 21, 2014

@jenbennings @haustraliaer I'm going to go with navigator.language with en-US as a default/fallback. Should we have some UI in case user wants to change language?

@jsuder how does hive-osx handle it? use the system language?

@mackuba
Copy link
Member

mackuba commented Jul 21, 2014

Yup, whatever is set in the system preferences, with English as fallback. No in-app UI needed. But I guess it might be different in case of a web app - Cocoa apps usually don't have language switches, but web apps very often do...

@weilu weilu added the feature label Jul 23, 2014
@weilu
Copy link
Member

weilu commented Jul 23, 2014

  • extract translation strings
  • currency format
  • date format

@tgerring
Copy link
Member

tgerring commented Aug 1, 2014

I stumbled upon this jQuery localization tool that might be interesting: https://darksmo.github.io/jquery-localization-tool/

weilu added a commit that referenced this pull request Aug 2, 2014
@weilu weilu merged commit 75d259a into master Aug 2, 2014
@weilu weilu deleted the i18n branch August 2, 2014 05:46
@weilu weilu removed the WIP label Aug 2, 2014
@weilu
Copy link
Member

weilu commented Aug 2, 2014

Moved number and date format into separate issues: #184 #185

@mackuba
Copy link
Member

mackuba commented Aug 4, 2014

If I can suggest something - I think you should always put complete labels into the translation file, and avoid splitting them. The reason is that you can't always predict how different languages will treat various things, they can sometimes do weird stuff you can't imagine.

E.g. if you have a label "Are you sure?", you could write it as {{translate("Are you sure")}}?. However, in Spanish questions also have a "¿" at the beginning, and in Greek they have a semicolon at the end :) They might want to put the parts in a different order, or they might need to use different grammatical form depending on the context, and so on.

Examples of strings in the current file that I would change:

  • "Back to" -> back to what? (I know, hivewallet.com, but they don't know that)
  • "Enter your PIN", "Set a PIN for quick access" etc. -> don't leave the colon outside the string
  • "This might take some time," + "please be patient" -> merge them with e.g. a \n and split them back in code - it's not even obvious for the translator that these two are two parts of one thing (or maybe it's possible to just do it in CSS somehow, without the \n?)
  • "name", "email" - where do these come from?
  • "description" - is there any way to add some kind of comment for the translator to the label? it's hard to figure out where this is supposed to be used

@weilu
Copy link
Member

weilu commented Aug 5, 2014

@jsuder Good points!

"Back to" -> back to what? (I know, hivewallet.com, but they don't know that)

Updated

"Enter your PIN", "Set a PIN for quick access" etc. -> don't leave the colon outside the string

There are cases where we can share the translation if we leave the colon outside (e.g. {{translate("Your wallet address")}}: and {{translate("Your wallet address")}}). Do we know of any language where the colon might be a problem?

"This might take some time," + "please be patient" -> merge them with e.g. a \n and split them back in code - it's not even obvious for the translator that these two are two parts of one thing (or maybe it's possible to just do it in CSS somehow, without the \n?)

I think this is the only place where I didn't combine the two halves of a sentence into a single string, because they still make sense staying as separate strings.

"name", "email" - where do these come from?

Support form

"description" - is there any way to add some kind of comment for the translator to the label? it's hard to figure out where this is supposed to be used

I agree. It is for the support form. Maybe we should change it to something more specific like "support request detail"? cc. @jenbennings @haustraliaer

@weilu
Copy link
Member

weilu commented Aug 5, 2014

I feel bad changing the source file strings and have the translators retranslate those strings. In some cases, like waggle -> Waggle, I feel like I could update the translated files & batch upload them but I fear that it might overwrite some translation that has been done between the time I pulled down the files and upload the files. @jsuder any suggestions?

@mackuba
Copy link
Member

mackuba commented Aug 6, 2014

Yeah, I totally know the feeling. Sometimes I try to avoid that if I can (e.g. when I was replacing "passphrase" with "password" I manually went through all the files and copied what I could, since there was a very similar string that already contained "password").

To make sure you don't overwrite something, I'd just stash your changes, pull all the latest changes from the server, with -f just to be sure (tx pull -a -f - tx compares modification dates so it sometimes gets confused if you modify a file both locally and remotely and doesn't pull the remote changes unless you add -f), and then if there are no changes, pop the stash and push whatever you've changed. If there are conflicts, merge and repeat.

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

Successfully merging this pull request may close these issues.

3 participants