Page 1 of 1

generate pot. file to translate a module analysis, results and ui ?

Posted: Fri Aug 02, 2024 1:52 pm
by jcthrawn
Hi,

I want to translate a Jamovi module I'm making in french for my students, but I wonder : is there a simple way to generate a pot. file containing all analysis, results and ui options (titles, descriptions and labels), like the ones in jmv/jamovi/i18n ? I thought about using yaml::read_yaml() to build it manually, but I guess there are more straightforward approaches.

Brice

Re: generate pot. file to translate a module analysis, results and ui ?

Posted: Fri Aug 02, 2024 11:04 pm
by jonathon
ah, we definitely have this functionality, but i don't think we've surfaced it in jmvtools ... in order to do it, you'll have to invoke the "jamovi compiler" directly. here's the usage info for the compiler:

Code: Select all

    let usage = 'Usage:\n';
    usage += '    jmc --build path\n';
    usage += '    jmc --prepare path\n';
    usage += '    jmc --install path     [--home path]\n';
    usage += '    jmc --check            [--home path]\n';
    usage += '\n';
    usage += '    jmc --i18n path  --create code     [--verbose]\n';
    usage += '                     --update [code]   [--verbose]\n';
so i think you'll want

jmc --i18n path/to/your/module --create fr

however, unless you install the compiler as a global node module, you won't be able to just call 'jmc', rather you'll want to use:

path/to/node path/to/compiler-index.js --i18n path/to/your/module --create fr

to figure out the paths here, you can use the commands (from R, with jmvtools installed), node::node() and jmvtools:::jmcPath() (note that you have to use three colons in jmvtools:::jmcPath()).

jonathon

Re: generate pot. file to translate a module analysis, results and ui ?

Posted: Mon Aug 05, 2024 5:22 am
by jcthrawn
Hi Jonathon,

Thank you very much, I'll try it right now ! 

Brice