# Adding new words to .mo files

**URL:** https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611
**Category:** Help Topics
**Created:** [June 11, 2015, 8:34am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611 "2015-06-11T08:34:26Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![doggingg](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@doggingg](https://community.xibo.org.uk/u/doggingg)
#### Post date: [June 11, 2015, 8:34am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/1 "2015-06-11T08:34:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dan](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/dan/32/9115_2.png) [@dan](https://community.xibo.org.uk/u/dan)
#### Post date: [June 11, 2015, 3:16pm UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/2 "2015-06-11T15:16:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![doggingg](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@doggingg](https://community.xibo.org.uk/u/doggingg)
#### Post date: [June 12, 2015, 2:00am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/3 "2015-06-12T02:00:52Z")

</div>

Thank you, dan.

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

---

<div class="post-metadata">

### Author: ![alex](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/alex/32/5782_2.png) [@alex](https://community.xibo.org.uk/u/alex)
#### Post date: [June 12, 2015, 7:51am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/4 "2015-06-12T07:51:12Z")

</div>



---

<div class="post-metadata">

### Author: ![alex](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/alex/32/5782_2.png) [@alex](https://community.xibo.org.uk/u/alex)
#### Post date: [June 12, 2015, 8:11am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/5 "2015-06-12T08:11:27Z")

</div>



---

<div class="post-metadata">

### Author: ![doggingg](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@doggingg](https://community.xibo.org.uk/u/doggingg)
#### Post date: [June 12, 2015, 8:13am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/6 "2015-06-12T08:13:28Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dan](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/dan/32/9115_2.png) [@dan](https://community.xibo.org.uk/u/dan)
#### Post date: [June 12, 2015, 10:17am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/7 "2015-06-12T10:17:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![doggingg](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@doggingg](https://community.xibo.org.uk/u/doggingg)
#### Post date: [June 15, 2015, 5:12am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/8 "2015-06-15T05:12:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dan](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/dan/32/9115_2.png) [@dan](https://community.xibo.org.uk/u/dan)
#### Post date: [June 19, 2015, 2:41pm UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/9 "2015-06-19T14:41:07Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![doggingg](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@doggingg](https://community.xibo.org.uk/u/doggingg)
#### Post date: [June 22, 2015, 7:21am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/10 "2015-06-22T07:21:29Z")

</div>

Hi, Dan

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

---

<div class="post-metadata">

### Author: ![alex](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/alex/32/5782_2.png) [@alex](https://community.xibo.org.uk/u/alex)
#### Post date: [June 22, 2015, 7:42am UTC](https://community.xibo.org.uk/t/adding-new-words-to-mo-files/2611/11 "2015-06-22T07:42:11Z")

</div>


