Skip to content

Conversation

wpferguson
Copy link
Member

@wpferguson wpferguson commented Oct 21, 2024

Final fixes to Lua translation being handled by darktable.

Fixes darktable-org/darktable#17699.

@wpferguson wpferguson added the WIP Work in Progress label Oct 21, 2024
@wpferguson
Copy link
Member Author

Fixed page %d of %d

                              name string instead of the filename

tools/script_manager - change get_script_metadata to retreive a
                       script metadata block and store it as a
                       metadata block making the indiviual fields
                       accessible.

                       change the script buttons to use the translated
                       name if available and just the purpose for the
                       tooltip.
@wpferguson
Copy link
Member Author

@TurboGit latest commit makes the button name use the translated metadata block name. I only did official/apply_camera_stryle as a test so I need to give the rest of the scripts real_names (not just the filename) and make them translatable.

removing underscores, spelling out abbreviations, etc.
@wpferguson
Copy link
Member Author

Made all the script names into names that are translatable.

Except for photils. Not sure what to do with that.

                       cleaned up metadata handling (trimmed whitespace and comments)
		       fixed bug with folder names partially matching other folder names
@wpferguson
Copy link
Member Author

Added translated folder names. That should be the last item. @TurboGit do you want to play with it or do you want me to merge and push?

@TurboGit
Copy link
Member

Just tested, it is better but I have some new issues:

  • I don't have the tooltip with purpose/author/help text, only the purpose line is displayed. Is that expected?
  • When a module is activated it is not translated into dt. I have enabled enfuse

The menu in Scripts is translated:

image

(See Fusion avec enfuse)

But when I activated the module I get in dt module list:

image

That is the title of the module could be using the translated label maybe? And the whole interface is not translated.

@wpferguson
Copy link
Member Author

wpferguson commented Oct 23, 2024

I don't have the tooltip with purpose/author/help text, only the purpose line is displayed. Is that expected?

I was grabbing the metadata block as just text and formatting it for display as a tooltip. Now I actually grab the block and put it in a table so that I can use the individual fields (name is now translated and used for the button text, purpose is now the tooltip, author isn't currently used, and help should eventually get coupled to a shortcut so that the webpage can be opened). The tooltip can show whatever information we want it to. I can add more fields to the metadata if we need to. For now I just made it purpose, so it's a "real" tooltip, but I'm open to suggestions.

EDIT:

When a module is activated it is not translated into dt. I have enabled enfuse.

That is the title of the module could be using the translated label maybe? And the whole interface is not translated.

Fixed. I just missed it. I was so focused on fixing the existing stuff I over looked the missing stuff.

@wpferguson
Copy link
Member Author

Went through and found the other libs that didn't have the module name translated

@TurboGit
Copy link
Member

I'll do another pass on this soon and will report back. Thanks for the hard work!

@TurboGit
Copy link
Member

Went through and found the other libs that didn't have the module name translated

All good to me, please do a new PR to update the Lua submodule. Thanks!

@wpferguson wpferguson merged commit 3a1f6bb into darktable-org:master Oct 27, 2024
@wpferguson wpferguson removed the WIP Work in Progress label Oct 27, 2024
@wpferguson
Copy link
Member Author

@TurboGit , the lua-scripts submodule doesn't show up in a fresh clone of master. Did something change?

@TurboGit
Copy link
Member

Missing the recursive clone ?

Now you can just:

$ cd darktable
$ git submodule init
$ git submodule update

@MStraeten
Copy link
Contributor

not sure why the directories containing the scripts in script manager should be translated - if "examples" is translated then i'd expected the directory path to be translated too - but that isnÄ't done on initial installation of scripts

@wpferguson
Copy link
Member Author

$ git clone https://github.com/darktable-org/darktable.git test_lua_submodule
Cloning into 'test_lua_submodule'...
remote: Enumerating objects: 296932, done.
remote: Counting objects: 100% (4091/4091), done.
remote: Compressing objects: 100% (1615/1615), done.
remote: Total 296932 (delta 3018), reused 3289 (delta 2471), pack-reused 292841 (from 1)
Receiving objects: 100% (296932/296932), 1.22 GiB | 53.93 MiB/s, done.
Resolving deltas: 100% (235364/235364), done.
$cd test_lua_submodule/
$ git submodule init
Submodule 'src/external/LibRaw' (https://github.com/LibRaw/LibRaw.git) registered for path 'src/external/LibRaw'
Submodule 'src/external/OpenCL' (https://github.com/KhronosGroup/OpenCL-Headers.git) registered for path 'src/external/OpenCL'
Submodule 'src/external/libxcf' (https://github.com/houz/libxcf.git) registered for path 'src/external/libxcf'
Submodule 'src/external/rawspeed' (https://github.com/darktable-org/rawspeed.git) registered for path 'src/external/rawspeed'
Submodule 'src/external/whereami' (https://github.com/gpakosz/whereami) registered for path 'src/external/whereami'
Submodule 'src/tests/integration' (https://github.com/darktable-org/darktable-tests.git) registered for path 'src/tests/integration'
$ git submodule update
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/external/LibRaw'...
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/external/OpenCL'...
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/external/libxcf'...
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/external/rawspeed'...
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/external/whereami'...
Cloning into '/home/bill/src/dtdev/test_lua_submodule/src/tests/integration'...
Submodule path 'src/external/LibRaw': checked out 'd3cbbd0e9934898eb28e4963ee99b51928e2acaa'
Submodule path 'src/external/OpenCL': checked out '4fdcfb0ae675f2f63a9add9552e0af62c2b4ed30'
Submodule path 'src/external/libxcf': checked out '64efecf63ddd952ccf654e479714aaae6f8c5986'
Submodule path 'src/external/rawspeed': checked out 'e3f16a78ebabfe5f1167d7bcc960c37515094d05'
Submodule path 'src/external/whereami': checked out 'e07bc35ecd92ee4c3ac71cf0fb6b01132bfa50de'
Submodule path 'src/tests/integration': checked out '3dd115f72fe15e72c154efd5d8a234f88bd5b8f7'

@wpferguson
Copy link
Member Author

if "examples" is translated then i'd expected the directory path to be translated too

I'm not sure I understand what you mean. Where are you seeing the directory path untranslated? Or, are you talking about the physical directory on disk?

The translation of directory names is done internally in script_manager.

The goal of script_manager is to hide the implementation details from the user since the original method of using the scripts (editing a luarc file) was deemed too difficult by the masses and a barrier to entry. For now the directory names are used more or less (contrib is now contributed even in English). The next step is to have user defined categories so the users can arrange the scripts into categories that make sense to them. At that point the physical layout of the scripts and the logical layout of the scripts will be completely separated.

@wpferguson
Copy link
Member Author

wpferguson commented Oct 28, 2024

@TurboGit the lua-scripts submodule got removed in 8a312fbaf464defcb8c8f44f309b156f01715503. Found it with a bisect.

a312fbaf464defcb8c8f44f309b156f01715503 is the first bad commit
commit 8a312fbaf464defcb8c8f44f309b156f01715503
Author: Hanno Schwalm hanno@schwalm-bremen.de
Date: Sun Oct 20 09:54:37 2024 +0200

Refactor dt_print to add newline automatically

Leaving out the burden thinking about a newline while using dt_print()

Original work done by @dterrahe

While being here and touching all those files, ensure all log message lines don't end
with a dot. (so far most did not, some did, and some even had a dot after an exclamation mark)

Nothing "big" but still worthwhile

src/external/lua-scripts | 1 -

EDIT: Should I close the PR that I submitted and that has a conflict because of the above and then just add the submodule with new master in another PR?

@TurboGit
Copy link
Member

Yes, just found about this this morning. Now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lua translation not 100% possible
3 participants