• 0

How to change a text string with POedit.

Question

Posted (edited) · Report post

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

Edited by Simon Prosser
make it readable in new forum

Share this post


Link to post
Share on other sites

34 answers to this question

  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

Thx Simon, a problem with POEDIT... Re-installed : everything ok. Cheers

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

Did you fill in the project info?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

Or, you can user the customize plugin instead of the base theme...

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I cannot, as I've installed Buddypress...

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

??? I had buddypress installed with the Customize Plugin, without Base Theme... no problems...

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

@simon what about translating pagelines using the base theme, is that possible?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@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
  • 0

Posted · Report post

@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
  • 0

Posted · Report post

Guys you can use both!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Okay, that's solved then.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@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
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Am I not suppose to ask this question in this thread or what ?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

and that main framework language folder will be overwritten at each update?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Yes it will.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

@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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Here comes a tip for you all. I use this plugin instead of POedit. It works out much better for me. [url="http://wordpress.org/extend/plugins/codestyling-localization/"]http://wordpress.org/extend/plugins/codestyling-localization/[/url] Anybody else using this plugin? Ping: @Simon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now