Open DreadKnight opened 8 years ago
Seems Gnome-Shell does things in a very similar way https://github.com/GNOME/gnome-shell/tree/master/po
The main issue with translations is that I have a tendency to use twitter like descriptions for unit abilities and such, so translating stuff which change the length of strings, not fitting within cards anymore.
An idea would be to not translate the text displayed initially within the cards themselves, but only show translations on the A card when an ability from the B card is hovered/clicked, this way it will be easier for people not speaking the same language to play the game on the same machine (playing with random strangers); when it comes to the ability tooltips displayed in-game on hover for the active unit, those could easily include translations. The issue regarding ability details in the same card area should be kept in mind when implementing this, #864.
Since TBS games are quite popular with russians, this guy might be helpful https://www.reddit.com/r/INAT/comments/510sm2/unpaidpaid_russian_translation_looks_for_a_game/
A solution for the pipeline workflow would be using this tool at it supports po files and git integration https://weblate.org
Another translation platform that offers free licences for open source projects is https://crowdin.com
This phaser plugin could be used if it actually brings important things to the table https://github.com/orange-games/phaser-i18next
I could help with the translations and can recommend crowdin or weblate.
@jony0008 It will take a while for translations to happen probably. Thanks for the recommendations, will look into them when the time comes. Which languages you would be able to help with btw?
@DreadKnight I see. I can help with the Swedish translation.
@jony0008 That's cool. Good news: more people showed up recently with interest in translating (into Spanish) so I'll get things going with the workflow for this.
@jony0008 this is now closer on the roadmap, I've added the ids for the pre-match menu, feel free to translate https://github.com/FreezingMoon/AncientBeast/blob/master/assets/translations/en/pre-match.json
Is this still open? I saw this in the code:
// TODO: Move strings to external file in order to be able to support translations
FWIW, one handy way to handle translations in code is to leave user-facing strings in place, but wrap them in a function, often t("string to translate")
or tr("string to translate")
. The function returns the translation in the user's language if one exists. Otherwise it returns the original string.
It tends to be a lot handier than the equivalent: translations.[user.language].greetingString;
It lets programmers make new strings without a lot of fuss, as they simply type the primary language string out in the code.
And if you want to get all the t()
strings to put in a spreadsheet for translators, it'd be pretty easy to write a regex to find them.
Is this still open? I saw this in the code:
// TODO: Move strings to external file in order to be able to support translations
FWIW, one handy way to handle translations in code is to leave user-facing strings in place, but wrap them in a function, often
t("string to translate")
ortr("string to translate")
. The function returns the translation in the user's language if one exists. Otherwise it returns the original string.It tends to be a lot handier than the equivalent:
translations.[user.language].greetingString;
It lets programmers make new strings without a lot of fuss, as they simply type the primary language string out in the code.
And if you want to get all the
t()
strings to put in a spreadsheet for translators, it'd be pretty easy to write a regex to find them.
Indeed, I'm aware; there are probably already npm packages out there to create a task to scan code in order to generate a dictionary type of list that would serve as a template to be forked and translated in any language.
What I also liked about this approach is that besides avoiding a lot of the fuss of separating strings, it could way easier avoid having orphaned entries in the translation files, so in case the code gets removed, the string would be as well.
Only issue I see is if tweaking an already translated string a bit, but I think the advanced online editors dealt with this type of stuff rather nicely.
Even with a suitable package or a regex, stuff like this would probably need to be included in the nodejs game building functions nicely, like scan for new strings, changes or removals and the template could probably mark new/changed as well. Might have to take a peek and see if .po template/translation files have support for string statuses (another string status would be translated/completed).
Edit: seems po files don't include status, translation services do that sort of thing on their own using databases and such.
A problematic thing for the UI is that I've been very tweeterish about the ability stuff on the cards (I have OCDs), those might be displayed in English and have some translation balloons displayed on click/hover (on top of the artwork card).
Game and/or website could be translated by community at some point into several popular languages. This tool could probably be used https://poeditor.com - as it's free for approved open source projects.
Here's how GameJolt handles poeditor string translations within their own GitHub repository https://github.com/gamejolt/translations/tree/18d747de8c732f43301d84c03f62c51cc75b3c84