ProductOpener::Lang - load and return translations
ProductOpener::Lang
loads translations from .po files and return translated strings through the lang() and lang_sprintf() functions.
In some languages like French, colons have a space before them. e.g. "Valeur : 500" in French, "Value: 500" in English
This function returns a non-breaking space character for those languages.
Returns a translation for a specific string id in the language defined in the $lc global variable.
If a translation is not available, the function returns English.
In the .po translation files, we use the msgctxt field for the string id.
Returns a translation for a specific string id with specific arguments in the language defined in the $lc global variable.
The translation is stored using Python's f-string format with named parameters between { }.
e.g. "This is a string with {a_variable} and {another_variable}."
Variables between { } are interpolated with the corresponding entry in the $variables_ref hash reference.
If a translation is not available, the function returns English.
In the .po translation files, we use the msgctxt field for the string id.
Reference to a hash that contains values for the variables that will be replaced.
Returns a translation for a specific string id with specific arguments in the language $target_lc.
The translation is stored using Python's f-string format with named parameters between { }.
e.g. "This is a string with {a_variable} and {another_variable}."
Variables between { } are interpolated with the corresponding entry in the $variables_ref hash reference.
If a translation is not available, the function returns English.
=head4 target language $target_lc
In the .po translation files, we use the msgctxt field for the string id.
Reference to a hash that contains values for the variables that will be replaced.
Returns a translation for a specific string id in a specific language.
If a translation is not available, the function returns English.
In the .po translation files, we use the msgctxt field for the string id.