darktable-org / lua-scripts

148 stars 108 forks source link

POC: translation done by darktable. #450

Open TurboGit opened 5 months ago

TurboGit commented 5 months ago

This is a POC on how Lua script translation could be handled directly in darktable.

The darktable part

This will make it possible with the current main darktable translation workflow to also translate the scripts.

The Lua script part

Redesign

@wpferguson : This is my current idea to make Lua scripts a first class citizen. Let me know how it sounds to you.

I hope I have not missed something, but at least with this POC I was able to translate Lua scripts in French.

TurboGit commented 5 months ago

@wpferguson : All this is quite some work, so if you agree with the general direction I'd propose to concentrate on the two scripts in this PR. The main script manager and the copy_paste_metadata plug-in. When (if) we can get this working properly then we'll have a clear idea of the transition for all others plug-ins.

wpferguson commented 5 months ago

Remove any spaces in start or end of strings, the layout must not be done in strings. I see for example "of " and some other cases.

The problem is the way we format output, i.e.dt.print(_("export ")..tostring(number).." / "..tostring(total)). We could either .dt.print(_("export") .. " " ..tostring(number).." / "..tostring(total))or dt.print(string.format(_("export %d/%d", number, total))

TurboGit commented 5 months ago

dt.print(string.format(_("export %d/%d", number, total))

Yes, seems close to what is done on darktable core.

wpferguson commented 5 months ago

Does this match what you translated?

script_manager script_manager2 copypaste

TurboGit commented 5 months ago

Does this match what you translated?

Yes I recognize the few strings I have translated there. So it's working.

wpferguson commented 5 months ago

I think the next step should be to clean up what we have, before we start adding new things.

wpferguson commented 2 months ago

@TurboGit how do want to proceed on this? Do you want me to push what I have to your branch do you want to look at #455 and see if I've covered everything?

TurboGit commented 2 months ago

@wpferguson : I'll have a look at #455 and we will decide what to do next.

wpferguson commented 1 month ago

@TurboGit I think this is how we should proceed on this:

TurboGit commented 1 month ago

@wpferguson : Agreed I keep pushing back on this because of other priorities, sorry for that. So yes we should aim at 5.0 now and start working on this just after 4.8 is out.

  • I'll add bindtextdomain back into ...

You mean that even if bindtestdomain is added we still have a proper translation for known strings in a different domain?

wpferguson commented 1 month ago

If I put bindtextdomain back, then the current translations we have will still work, minus the strings I changed.

When we start 4.9, I'll bump the API then remove the bindtextdomain again and merge that into the development branch. Anyone using master will get the development branch to develop and test against.