tolgee-platform icon indicating copy to clipboard operation
tolgee-platform copied to clipboard

Exporting translations: remap tags

Open IceflowRE opened this issue 11 months ago • 4 comments

Is your feature request related to a problem? Please describe. Iam currently developing a Tolgee integration for a game engine. This engine uses a different language tag system. It is easy to map this system to BCP 47, so i can import the translations and create languages, the problem is when exporting the translation files from Tolgee, they would have language tags which are not supported.

The import step has already this with languageMappings.

Describe the solution you'd like The export API endpoints (GET/POST) could have another optional parameter languageMappings which maps Tolgee tags to the desired output tag. All files which would write the Tolgee language tag will instead write the remapped language tag.

Describe alternatives you've considered An alternative would be to alter the exported files, but this is not as easy as just adding this as a Tolgee feature.

IceflowRE avatar Apr 01 '25 18:04 IceflowRE

Hello!

Thanks for reaching. I am not sure whether we would be able to add this, since it looks like an edge case with a possible workaround of handling it using some custom script after downloaded.

Would such workaround work for you?

JanCizmar avatar Apr 07 '25 08:04 JanCizmar

Hello!

Thanks for reaching. I am not sure whether we would be able to add this, since it looks like an edge case with a possible workaround of handling it using some custom script after downloaded.

Would such workaround work for you?

The problem with such a custom script is that i have to parse either CSV or PO, or other formats and change the language tag. I would had to basically implement the format parsing and editing, which Tolgee has already natively. Another small workaround would be to use Regex search and replace, but those are always very error prone.

IceflowRE avatar Apr 07 '25 10:04 IceflowRE

Just found that the import step has already a language mapping, so just the export step has it missing.

IceflowRE avatar Apr 11 '25 18:04 IceflowRE

You're right it seems like adding language mapping to export makes sense.

Although, we currently don't have enough manpower to address it now. I will leave this issue open to see if more people will request this.

If you feel brave enough, we will appreciate a PR implementing this ❤️

JanCizmar avatar Apr 14 '25 07:04 JanCizmar