I've made a patch for MDL-32275 which need a new language string added, is there anything I need to do to make sure it is translated properly ? I don't see the documentation referencing to the process to adding new language strings.
Adding new language strings ?
Number of replies: 4Re: Adding new language strings ?
p.s. I'll be happy to hear what particular part of the docs wasn't clear to you so we can eventually improve it.
Re: Adding new language strings ?
Didn't know whether to start a new thread on this - let me know if you think I should but... I am adding a new language string to a Feedback plugin. It has a variable in it. So I am handing the value to the get_string function like this:
$info->userid = $userid;
echo '<p>'.get_string('mgremailmissing', 'feedback', $info).'</p>';
In the lang/en/feedback.php file:
$string['mgremailmissing'] = 'If your manager\'s email address is missing or incorrect, <a href="#" onclick="modalWin({a->userid})" style="font-weight:bold;" title="Add your manager\'s email">click here </a> to select it ... etc';
The variable is not getting translated, it gets sent back to the page as is: {a->userid}
This approach has worked for me in other instances. I am trying to figure out what is different here. ??
Thanks!
Re: Adding new language strings ?
It has to be {$a->userid}
not {a->userid}
.
Putting JS and CSS into the strings is not something I would recommend to do though. On the other side, this is apparently part of some you local customization that is not supposed to be shared, so it's all your playground (why do you do it via strings then by the way?)
Re: Adding new language strings ?
Thank you!! I didn't see that syntax error. Wow - and I worked on that for a while.... oh well - thanks! We are not using JS or CSS in our strings. Just sending some dynaimc values to the otherwise static string.