Adding new words to .mo files

Dear Xibo developers

I got a question want to ask.
I changed some words in the code of PHP files.
If I want to add the words to locale/zh_TW.mo file, how should I do???

Thanks.

You’d need to re-parse the files into a POT and translate manually… using something like PoEdit. Unless your changes are something that the project should also change, in which case we can raise a bug for it and get it fixed in the next release.

Thank you, dan.

That’s really useful for me.
Thank you very much.

Dear Xibo developers

Thanks your previous response.
My condition is that I create a new word in the php code.
Ex: At display page, I create a “Preview” word next to default layout button. Then I add this new word to default.pot file and output to zh_TW.mo file. But it doesn’t to be translated.
What step I missed???

Thank you for reading.

Please can you provide a code snippet for what you have changed?

Hi, Dan

Sure.
I use Xibo version 1.2.0.
Here is the code segment I new added in display.class.php, line 547.
Code: &button id=“preview_btn” class=“XiboFormButton” onclick=“Preview($displayid, ‘$defaultlayout_url’, this);” &&span&Preview&/span&&/button&

I’m sorry that the code can not be display directly on the webpage, so I change “<”, “>” symbol to “&”.

The word “Preview” between “span” tag wasn’t exist in the original default.pot and display.class.php file.
I created it.
If I want this word can be translated to zh_TW correctly.
How should I do???

Thanks.

Translatable strings have to be enclosed in __() so that they are translated at run time - it doesn’t just translate text (otherwise it wouldn’t know what to translate)

Hi, Dan

It works.
Thank you so much.
That really solved my problems.