Describe the project you are working on
A plugin with strings to translate.
Describe the problem or limitation you are having in your project
Currently the only way to regenerate POT files is via the localization editor's POT Generation tab. This is the only part of the gettext localization pipeline that can't be automated.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
If POTGenerator::generate_pot were exposed to GDScript, you could easily write a script that calls generate_pot with your desired POT file location. This would fill the hole where you'd normally use xgettext. After that, the rest of the gettext flow works as normal.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Presuming that the POTGenerator singleton and its generate_pot method were available, you could write a simple SceneTree script like:
extends SceneTree
func _init():
POTGenerator::generate_pot("po/myproject.pot")
quit()
Then you could run it like godot --path . --headless --script genpot.gd as part of your translation pipeline.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't believe there's any way to manage this from a script since none of the necessary functionality is exposed to GDScript. Without the enhancement, you'd have to use the POT Generation tab in the editor whenever translatable strings change.
Is there a reason why this should be core and not an add-on in the asset library?
Until the core exposes POTGenerator, there's no way to provide this functionality from an add-on.
Describe the project you are working on
A plugin with strings to translate.
Describe the problem or limitation you are having in your project
Currently the only way to regenerate POT files is via the localization editor's POT Generation tab. This is the only part of the gettext localization pipeline that can't be automated.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
If
POTGenerator::generate_potwere exposed to GDScript, you could easily write a script that callsgenerate_potwith your desired POT file location. This would fill the hole where you'd normally usexgettext. After that, the rest of the gettext flow works as normal.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Presuming that the
POTGeneratorsingleton and itsgenerate_potmethod were available, you could write a simpleSceneTreescript like:Then you could run it like
godot --path . --headless --script genpot.gdas part of your translation pipeline.If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't believe there's any way to manage this from a script since none of the necessary functionality is exposed to GDScript. Without the enhancement, you'd have to use the POT Generation tab in the editor whenever translatable strings change.
Is there a reason why this should be core and not an add-on in the asset library?
Until the core exposes
POTGenerator, there's no way to provide this functionality from an add-on.