Hi,
I have a case where I read my UI strings from file. This file comes from 3rd party so I have no control. These strings are then presented to the user in the UI so they cannot be literal strings in my php code and they need to be translatable. Basically this is what I have:
$strings = parse_my_stuff();
// show the strings to the user, so I need to make them translatable
foreach($strings as $s) {
t($s); // @potx: please don't complain here
}
So I would like to ask for two features:
1) a special comment marker for potx to silence it warning. Basically telling potx I know what I'm doing so don't warn here
2) a hook_potx() to get an array of strings to be part of the extract. Potx can look for a file in this patern: mymodule.potx.php and inside a function mymodule_potx() that returns a array of strings. Treat the strings in this array as part of the extract. So for my example, my hook_potx is:
function mymodule_potx() {
return parse_my_stuff();
)
Comments
Comment #1
gábor hojtsyt() was not designed to translate anything but code defined (literal) strings, so it will obviously keep complaining. If you want to translate user defined strings, use the i18nstrings.module and its tt() function.