FreezingMoon / AncientBeast

Turn Based Strategy Game. Master your beasts! 🐺
https://AncientBeast.com
GNU Affero General Public License v3.0
1.63k stars 554 forks source link

game translations #923

Open DreadKnight opened 8 years ago

DreadKnight commented 8 years ago

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

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/32407708-game-website-translations?utm_campaign=plugin&utm_content=tracker%2F260151&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F260151&utm_medium=issues&utm_source=github).
DreadKnight commented 8 years ago

Seems Gnome-Shell does things in a very similar way https://github.com/GNOME/gnome-shell/tree/master/po

DreadKnight commented 8 years ago

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.

DreadKnight commented 7 years ago

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/

DreadKnight commented 7 years ago

https://www.reddit.com/r/INAT/comments/5ahzun/will_translate_your_game_into_russian_for_free/

DreadKnight commented 6 years ago

A solution for the pipeline workflow would be using this tool at it supports po files and git integration https://weblate.org

DreadKnight commented 6 years ago

Another translation platform that offers free licences for open source projects is https://crowdin.com

DreadKnight commented 6 years ago

This phaser plugin could be used if it actually brings important things to the table https://github.com/orange-games/phaser-i18next

DreadKnight commented 6 years ago

http://rasmusrasmussen.com/2017/10/06/how-to-translate-a-game-13-the-process http://rasmusrasmussen.com/2017/10/13/how-to-translate-a-game-23-preparation-and-tools http://rasmusrasmussen.com/2017/10/30/how-to-translate-a-game-33-gamemaker-studio-2-example

ghost commented 5 years ago

I could help with the translations and can recommend crowdin or weblate.

DreadKnight commented 5 years ago

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

ghost commented 5 years ago

@DreadKnight I see. I can help with the Swedish translation.

DreadKnight commented 5 years ago

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

DreadKnight commented 5 years ago

@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

andretchen0 commented 1 year ago

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.

DreadKnight commented 1 year ago

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.

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.

DreadKnight commented 1 year ago

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.

DreadKnight commented 1 year ago

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