Page 1 of 1
Is it possible to export a particular game's translatable strings?
Posted: 21 February 2022, 18:31
by Joe
The reason I am asking is because I regularly use a CAT tool for my board game translations and it allows for a Translation Memory together with a Glossary (to keep terminology consistent), among other things. As the translation tool on BGA is bare-bones, it would really help to translate the strings for a Game in a CAT tool to be consistent etc. and then import them back into BGA - and of course allow for further tweaking as-is.
Is such a thing possible - and/or could it be?
Thx!
Joe
Re: Is it possible to export a particular game's translatable strings?
Posted: 26 February 2022, 14:15
by Een
I understand you are a professional translator using specialized software? Thanks for your interest in helping with translations.
Our translation system is geared up towards a community of non-professionals, and unfortunately we don't have the possibility at the moment to invest into building to/from specific software.
Re: Is it possible to export a particular game's translatable strings?
Posted: 26 February 2022, 16:30
by Joe
Thx! I am an amateur (i.e. not my paying job), but already translated many boardgames
Perhaps in the future some way can be found to dump a game's strings into a file and even to develop games with external translations in mind.
Is there pergaps a way to contact a dev of one of the simpler games, to see if he can share the game's files, so that it could be determined, if a "string dump" could be done?
Thx!
Joe
Re: Is it possible to export a particular game's translatable strings?
Posted: 27 February 2022, 00:24
by KongKing123
Joe wrote: ↑26 February 2022, 16:30
Perhaps in the future some way can be found to dump a game's strings into a file and even to develop games with external translations in mind.
It's quite trivial to write a script that extracts the translation textbox contents from a single page. I'm not a JavaScript developer, but I managed to whip this up with some quick research. It might come in handy for me as well.
Code: Select all
// adapted from https://www.encodedna.com/javascript/how-to-get-all-textarea-in-a-form-using-javascript.htm
const textAreaElements = document.getElementsByTagName("textarea");
const translationPrefix = "toTranslate_";
let translationContents = "ID|Source|Translation" + "\n";
for (let i = 0; i <= textAreaElements.length - 1; i++) {
let currentElement = textAreaElements[i];
let currentElementId = currentElement.id;
if (currentElementId.startsWith(translationPrefix)) {
let translationId = currentElementId.substring(translationPrefix.length);
let translatedElement = document.getElementById("current_" + translationId);
translationContents += translationId + "|" + currentElement.value + "|" + translatedElement.value + "\n"; // e.g. 90222|Enabled|Ingeschakeld
}
}
console.log(translationContents);
You can run this from your browser's console using the developer tools (usually under the F12 key). Edit the "translationContents +=" line for different output (e.g. separators).
Re: Is it possible to export a particular game's translatable strings?
Posted: 27 February 2022, 13:40
by Joe
Thx! Will try it out when I get back from vacation
