Page 1 of 1

Strings for translation

Posted: Sat Mar 29, 2025 2:04 am
by yurismol
Dear module developers!
Can you enclose text output strings in .("Some String") function symbols?
Only in *.b.R files.
This makes it easier to translate your modules into other languages.
P.S. I think Jonathon will agree with me.

Re: Strings for translation

Posted: Sun Mar 30, 2025 12:29 am
by jonathon
Hi Yuri,

Yes, in order to translate modules, you can surround your text with the .() function as you describe.

Is that what your asking? I feel like i'm not answering your question, sorry!

jonathon

Re: Strings for translation

Posted: Sun Mar 30, 2025 4:07 pm
by yurismol
I just ask other module developers to do this

Re: Strings for translation

Posted: Mon Mar 31, 2025 7:45 pm
by sbalci
Would you please give an example.

Re: Strings for translation

Posted: Mon Mar 31, 2025 8:39 pm
by yurismol
For example (in *.b.R file):
matrix$addFootnote(rowNo=i, paste0(colVarName, '[r]'), .('Pearson correlation cannot be calculated for non-numeric values'))
or
nm <- jmvcore::format(.('Matrix #{i}'), i=nCl)

You need to add importFrom(jmvcore,.) to NAMESPACE file first

+ If you want make a translation file:
jmvtools::i18nCreate("langcode")
and
jmvtools::i18nUpdate("langcode")
after making changes

Re: Strings for translation

Posted: Tue Apr 01, 2025 11:03 am
by sbalci
Thank you

Re: Strings for translation

Posted: Thu Apr 24, 2025 1:22 pm
by DStuder
Seems like a good idea. I've been trying to do exactly that but have struggled with it as I could not find any information on how to add translation to a module. It would be immensely helpful if this topic would be explained in the official jamovi documentation on module development: https://docs.jamovi.org/_pages/developer-hub.html. I'm sure yurismol or someone else from the community could help with writing the documentation?

Re: Strings for translation

Posted: Thu Apr 24, 2025 1:31 pm
by yurismol
DStuder wrote: Thu Apr 24, 2025 1:22 pm Seems like a good idea. I've been trying to do exactly that but have struggled with it as I could not find any information on how to add translation to a module. It would be immensely helpful if this topic would be explained in the official jamovi documentation on module development: https://docs.jamovi.org/_pages/developer-hub.html. I'm sure yurismol or someone else from the community could help with writing the documentation?
I can, but I think Jonathon would do it better.