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 support #1

Open
testzcrypto opened this issue May 20, 2017 · 19 comments
Open

Localization support #1

testzcrypto opened this issue May 20, 2017 · 19 comments

Comments

@testzcrypto
Copy link

Please add localization support as .json or .pot/.po files. I will configure for you the localization project as we did it for https://crowdin.com/project/esteem

@aaroncox
Copy link
Owner

That looks great! I'll get started on this.

@clayop
Copy link

clayop commented May 21, 2017

Great idea. Please be advised that some languages have different grammar orders from English. So translators can deal with full messages.

@testzcrypto
Copy link
Author

Crowdin open source project is ready: https://crowdin.com/project/vessel

@aaroncox
Copy link
Owner

aaroncox commented May 22, 2017 via email

@testzcrypto
Copy link
Author

Excellent, here the some examples:
tt() - https://github.com/steemit/condenser/tree/1070-i18n-refactoring
gettext .pot/.po files - https://github.com/byteball/byteball
.json localization files - https://github.com/eSteemApp/esteem

aaroncox added a commit that referenced this issue May 22, 2017
references #1 - The initial code for localizing the entire wallet.
@aaroncox
Copy link
Owner

I've got the initial code started, but I need to go through the rest of the wallet and convert everything to FormattedMessages.

Does this look like an acceptable format?

https://github.com/aaroncox/vessel/blob/b19e6072935f0688da8d5ff758d429f57edb909d/app/locales/en.json

There will be one json file for each language, starting with en.json.

@testzcrypto
Copy link
Author

Excellent! But better to use structure like this (where strings grouped by sections):

{
  "general": {
    "name": "Vessel",
    "height": "Height"
  },
  "menu": {
    "overview": "Overview",
    "send": "Send",
    "vesting": "Vesting",
    "accounts": "Accounts",
    "settings": "Settings"
  }
}

How this looks in Crowdin:

@aaroncox
Copy link
Owner

I'll have to figure out how to do that - the library I'm using right now uses the dot notation to delineate namespaces for adding to the app.

@testzcrypto
Copy link
Author

You need to make and keep updated only en.json, all other languages files (based on en.json) Crowdin will create and sync update for you.

@testzcrypto
Copy link
Author

Dot notation it's exactly now this should be, but this dot notation should count the sections, so FormattedMessages("menu.settings") will return right result from json:

{
  "menu": {
    "overview": "Overview",
    "settings": "Settings"
  }
}

@testzcrypto
Copy link
Author

testzcrypto commented May 22, 2017

Also please check if library supports parameterized strings and allow you to make something like FormattedMessages("menu.transfer_successful", 1.0, "STEEM", account)

{
  "menu": {
    "overview": "Overview",
    "transfer_successful": "The {amount} {asset} successfully transferred to {account}"
  }
}
@aaroncox
Copy link
Owner

It does support parameterized strings. For reference, it's the react-intl library.

@aaroncox
Copy link
Owner

Just ran a test, the parameterized strings come out as such currently:

{
    "welcome": "Hello {name}, you have {unreadCount, number} {unreadCount, plural, one {message} other {messages}}",
}
@adrai
Copy link

adrai commented Jul 21, 2017

if there is some interest: there is an alternative to react-intl => react-i18next

@testzcrypto
Copy link
Author

@aaroncox Any news about localization?

@aaroncox
Copy link
Owner

@testzcrypto I've made some progress on learning how to implement it (on chainBB, not Vessel) that I hope to get implemented in Vessel at some point.

@testzcrypto
Copy link
Author

@aaroncox Any progress with localization support? Now when Vessel become very popular Steem wallet this issue become very important ;-)

@aaroncox
Copy link
Owner

@testzcrypto been in an epic battle with just keeping people connected to steemd, no progress to report at this time.

@testzcrypto
Copy link
Author

@aaroncox I understand, and will wait for news in localization support when it's become visible. Thanks for great job!

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