RedMser / godot-fluent-translation

Fluent Translation as Godot extension
https://godotengine.org/asset-library/asset/2937
Other
13 stars 0 forks source link

FTL generation #7

Closed RedMser closed 5 months ago

RedMser commented 5 months ago

Could take the PotGenerator class, create an abstract base class / plugin registration system, then allow generating FTL files the same way. Obviously needs larger upstream changes.

While POT uses English messages as translation keys, FTL has separate keys. So unlike POT, you'll want to enter translation keys into your UI, and have those get extracted like key = UNTRANSLATED. Not sure how this works with ETR/ETRN translations though (I don't think FTL supports spaces in translation keys, so those might need to be converted to a "compatible" format)...

Alternative approach would be a custom EditorPlugin that adds some kind of UI. This provides more flexibility:


First draft for how to configure this (no UI, just plaintext multiline):

locales = ["en", "de", ...]

[source files regex]
[generated ftl files]
...

Example syntax:

ui/(.+)\.tscn
i18n/{$1}.{$locale}.ftl
RedMser commented 5 months ago

Readme has been updated with up-to-date infos on how to use the feature