You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chew opened this issue
Dec 20, 2020
· 2 comments
· May be fixed by #22
Labels
backendThis issue or pull request relates to an issue/change on the backendlogisticsSomething that requires something out of our control (Geyser admins for example)
Rails has native i18n support (see config/locales).
In the code, you need to do the following:
t('key')
Or, in controllers:
I18n.t('key')
Assuming you have the corresponding value in config/locales/en.yml:
key: Global Value
You can specify the locale however we want. Maybe a dropdown for it in the navbar?
If there are no translations in the given language, it falls back to the default (English).
I've not much experience with Crowdin, but it should be pretty simple to figure out. I won't be the one able to make it, though.
On RubyMine, not sure about other clients, but selecting a t('string') and pressing CMD+0 hides it with the actual translation. Quite poggers
For strings specific to a file/controller, you simply need to do this:
In locale:
controller:
action:
key: Local Value
So in app/controllers/controller.rb method action or app/views/controller/action.html.erb you can do:
t('.key')
Which will put "Local Value" instead of "Global Value". It definitely saves on key length.
There are not many Strings right now, but we don't want to get too far behind.
The text was updated successfully, but these errors were encountered:
Chew
added
backend
This issue or pull request relates to an issue/change on the backend
logistics
Something that requires something out of our control (Geyser admins for example)
labels
Dec 20, 2020
You can specify the locale however we want. Maybe a dropdown for it in the navbar?
I think we should get this from the users IP (geo IP lookup) and allow the user to set it when logged in? Navbar would be good for non-logged-in users.
Im happy to add a branch to the https://github.com/GeyserMC/languages repo but I think we need things pulling into an en.yml first, then I can setup the submodule and crowdin config.
backendThis issue or pull request relates to an issue/change on the backendlogisticsSomething that requires something out of our control (Geyser admins for example)
Rails has native i18n support (see config/locales).
In the code, you need to do the following:
Or, in controllers:
Assuming you have the corresponding value in config/locales/en.yml:
You can specify the locale however we want. Maybe a dropdown for it in the navbar?
If there are no translations in the given language, it falls back to the default (English).
I've not much experience with Crowdin, but it should be pretty simple to figure out. I won't be the one able to make it, though.
On RubyMine, not sure about other clients, but selecting a t('string') and pressing CMD+0 hides it with the actual translation. Quite poggers
For strings specific to a file/controller, you simply need to do this:
In locale:
So in
app/controllers/controller.rb
methodaction
orapp/views/controller/action.html.erb
you can do:Which will put "Local Value" instead of "Global Value". It definitely saves on key length.
There are not many Strings right now, but we don't want to get too far behind.
The text was updated successfully, but these errors were encountered: