Jump to content

Archived

This topic is now archived and is closed to further replies.

Simon

How to change a text string with POedit.

Recommended Posts

Simon    247
Simon

In this quick tutorial I'm going to show you how to change a translatable string in PageLines Framework 2.x

Tools Needed:

Framework 2.x

pagelines-customize plugin

POedit - http://www.poedit.net/download.php

So as an easy example I'm going to show you how to change the 'Tagged with:' string as it was requested earlier today. ZaxfW.png

1. Make a 'language' dir in the customize plugin folder.

cMkCy.png

2. Open POedit and click file/open and navigate to the pagelines.pot file in pagelines/language folder ( you will need to select 'all files' to open it ) gPBhD.png

3. Now we need to find the string to translate, i used the find function to find the word 'tagged'.

zYnvu.png

4. Highlight the string to edit then add the new string in the bottom box.

uxvnQ.png

5. Now click Catelog/settings, you need to change a couple of fields before it will let you save. You have to change the team name and team email address. SH4FT.png

6. Now click 'save as' and navigate to your customize plugin folder, and change the filename to en_US.po Y5ZLM.png

It should save out 2 files like this:

OiNPc.png

Now refresh your page, it should be translated!

BqLMs.png

Share this post


Link to post
Share on other sites
annabelr    0
annabelr
Hi Simon, Trying to output new .po .mo files using the pagelines.pot file. Followed every step in your tutorial. Getting the following error msg from POEDIT : [code]pagelines.pot:1477: missing `msgstr[]' section[/code] I looked it up and can't see what's wrong. This result was achieved by forcing the opening of the .pot file in POEDIT (open with from finder), for when i try to open the file with the "new catalog from a POT file" POEDIT menu entry i get the following error messages in the log file (aproximate translation from french) : pagelines.pot is not a valid POT file, corrupted catalog (incorrect entries, msgstr used conjointly with msgid_plural... Could you point me out to a solution? Alternate POT file? Thx a lot. Cheers

Share this post


Link to post
Share on other sites
Simon    247
Simon
I used the one from the latest package, pagelines.zip. Just tried it again definatly works. You dont have to 'create a new catelog from pot file. You just open the pot with poedit then adjust the catalog settings then save as.

Share this post


Link to post
Share on other sites
annabelr    0
annabelr
Thx Simon, a problem with POEDIT... Re-installed : everything ok. Cheers

Share this post


Link to post
Share on other sites
ilkka    0
ilkka
Hi, thanks a lot for the tutorial, very helpful. I had success translating theme, although poEdit gives me an error every time I try to save: "en_US.po:4: field 'Last-Translator' still has initial default value". Any idea what is the problem here?

Share this post


Link to post
Share on other sites
Simon    247
Simon
Did you fill in the project info?

Share this post


Link to post
Share on other sites
jbrouwer    5
jbrouwer
Hi, How does this work with the base theme? I created a language folder in the base theme folder and followed the above steps. No results. It does work when I copy the language files in the pagelines/language folder. Or do I have to use the customize plugin (in addition to the base theme)? Thanks.

Share this post


Link to post
Share on other sites
Jackey    29
Jackey
Or, you can user the customize plugin instead of the base theme...

Share this post


Link to post
Share on other sites
jbrouwer    5
jbrouwer
I cannot, as I've installed Buddypress...

Share this post


Link to post
Share on other sites
Jackey    29
Jackey
??? I had buddypress installed with the Customize Plugin, without Base Theme... no problems...

Share this post


Link to post
Share on other sites
Simon    247
Simon
@jackey@melisgs.nl yes you can do it that way, the templatepack then installs all its stuff into the main framework folder, which means next time you upgrade all that could get nuked.

Share this post


Link to post
Share on other sites
Jackey    29
Jackey
Nice to know! Thanks for the warnng! Can one still do Base Theme And Customize Plugin? It sounds like asking for trouble.

Share this post


Link to post
Share on other sites
jbrouwer    5
jbrouwer
@simon what about translating pagelines using the base theme, is that possible?

Share this post


Link to post
Share on other sites
Simon    247
Simon
@jbrouwer The framework looks in either the customize directory if its installed or the main framework folder.

Share this post


Link to post
Share on other sites
Jackey    29
Jackey
@jbrouwer That's why I switched from the Base Theme to the plugin... Clearly no option for you... :(

Share this post


Link to post
Share on other sites
Simon    247
Simon
Guys you can use both!

Share this post


Link to post
Share on other sites
Jackey    29
Jackey
Okay, that's solved then.

Share this post


Link to post
Share on other sites
jbrouwer    5
jbrouwer
@simon In my experience you cannot do both (base or custumize plugin as Jackey was suggesting), only the main framework folder works (together with the custumize plugin) as you said before. However, would it be possible to make this work in the base theme as well? Seems to be double work to install the customize plugin next to the base theme. Thanks.

Share this post


Link to post
Share on other sites
pehja+    12
pehja
I am not sure I got this correct. But I would like to see that my language files were not overwritten each time the Page Line updates. They do when I use the base theme. Is it better to put them in the "customize plugin" and if so, can I still use Base Theme. If I should want to use Buddy Press.

Professionell musician | Webbdesigner | Apple freak

Pehja Production.png

Share this post


Link to post
Share on other sites
pehja+    12
pehja
Am I not suppose to ask this question in this thread or what ?

Professionell musician | Webbdesigner | Apple freak

Pehja Production.png

Share this post


Link to post
Share on other sites
Simon    247
Simon
Sorry, as i mentioned in the opening post, language files are taken from the customize plugin 'language' folder, and if that does not exist then they are taken from the main framework language folder.

Share this post


Link to post
Share on other sites
pehja+    12
pehja
and that main framework language folder will be overwritten at each update?

Professionell musician | Webbdesigner | Apple freak

Pehja Production.png

Share this post


Link to post
Share on other sites
Simon    247
Simon
Yes it will.

Share this post


Link to post
Share on other sites
holimed    0
holimed
Hiya, I have the base theme and customize plugin active and followed your tutorial step-by-step, but the changes are not visible on the site. Also tried putting the new files in the main language folder, even as a replacement to the pagelines.pot file, but no changes are visible in either case. I do refresh my cache before each loading. I run the latest framework version. Do I need to first add/activate something in the customize plugin pages? thanks, Nikki

Share this post


Link to post
Share on other sites
pehja+    12
pehja
@holimed, No theres no need for any activation. What language do you change. You should open the .po file of that language and edit that. Then when you save you will get a .mo and.po file. Drag them from your desktop to your theme/pagelines/language folder. It should work. But when you update PageLines the file will be overwritten. To avoid that, you will have to activate customize plugin. Then go to wp-content/plugins/pagelines-customize and create a new language folder. in that folder you put your translated .mo and.po files. Now you can update PageLines and your changes will remain. I am not a pro, so this is just how I did. Hope it helps.

Professionell musician | Webbdesigner | Apple freak

Pehja Production.png

Share this post


Link to post
Share on other sites

×