vessel icon indicating copy to clipboard operation
vessel copied to clipboard

Localization support

Open testzcrypto opened this issue 7 years ago • 19 comments

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

testzcrypto avatar May 20 '17 12:05 testzcrypto

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

aaroncox avatar May 20 '17 18:05 aaroncox

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

clayop avatar May 21 '17 05:05 clayop

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

testzcrypto avatar May 22 '17 05:05 testzcrypto

I started researching how to implement it properly today, hopefully I'll have some progress on it soon.

aaroncox avatar May 22 '17 07:05 aaroncox

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

testzcrypto avatar May 22 '17 07:05 testzcrypto

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.

aaroncox avatar May 22 '17 19:05 aaroncox

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:

testzcrypto avatar May 22 '17 19:05 testzcrypto

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.

aaroncox avatar May 22 '17 19:05 aaroncox

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 avatar May 22 '17 19:05 testzcrypto

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 avatar May 22 '17 20:05 testzcrypto

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}"
  }
}

testzcrypto avatar May 22 '17 20:05 testzcrypto

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

aaroncox avatar May 22 '17 20:05 aaroncox

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}}",
}

aaroncox avatar May 22 '17 20:05 aaroncox

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

adrai avatar Jul 21 '17 19:07 adrai

@aaroncox Any news about localization?

testzcrypto avatar Nov 30 '17 11:11 testzcrypto

@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.

aaroncox avatar Nov 30 '17 21:11 aaroncox

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

testzcrypto avatar Jan 13 '18 09:01 testzcrypto

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

aaroncox avatar Jan 15 '18 23:01 aaroncox

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

testzcrypto avatar Jan 16 '18 06:01 testzcrypto