Jump to content


Photo
- - - - -

Translating theme spesific phrases


This topic has been archived. This means that you cannot reply to this topic.
23 replies to this topic

#1 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 26 October 2010 - 12:21 AM

I'm using qtranslate language switcher to translate the site into Finnish, which is working fine except the theme specific phrases don't get translated (such as 'go to top', 'nn responses' and also, for some reason, 'comments'). Part of the theme text I've been able to translate directly in the php files, but not everything (like the phrases mentioned above).
I'd like to be able to translate those as well, and have used Poedit to translate the Station_po file. However I'm not able to get the translation to work.
Here's what I've tried so far (all together and in different combinations):
Named the translated files fi_FI.po and ...mo, uploaded them into the theme folder, added

Please Login or Register to see this Hidden Content

to functions.php, added define ('WPLANG', 'fi'); in the config.php, but no luck.
I've never done this before, so any pointers as to what I'm doing wrong would be appreciated. Alternatively, any advise on how and if those could be translated directly in the php files. Would be nice to have especially the 'comments' and 'responses' translated, as it looks a bit silly with everything else in Finnish...
The site in question is

Please Login or Register to see this Hidden Content

, in case that has any relevance. Theme is StationPro.

#2 arpowers

arpowers

    Founder

  • Administrators
  • 3254 posts

Posted 26 October 2010 - 02:47 AM

Hmm... Did you regenerate a translation file when you started? I checked the theme; and these strings were localized and didn't have any syntax errors that I saw...

#3 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 26 October 2010 - 02:59 AM

"Go To Top" - Where to find:

Appearance > Editor > _contentfooter.php

"Responses" / "Comments" - Where to find:

Appearance > Editor > _post_footer.php

Thanks, Bryan

#4 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 26 October 2010 - 10:59 PM

Bryan, I'm able to locate those files but don't get the translations to work for those particular ones, no idea why (except that I', obviously doing something wrong as it's pretty much guessqwork from my part. It's just so annoying as it's only a couple of simple phrases that still would need to be fixed...
I've used simple language tags for some of the translations in the php files, probably a highly incorrect way to do it but it works, just not with these particular terms.

Andrew, I did that too, and noticed the generated file was slightly different from the original station.po file - for example

Please Login or Register to see this Hidden Content

is missing there, and neither one has the plural form of the same.

#5 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 27 October 2010 - 03:41 AM

Oh, I see... I thought you merely needed to change them to Finnish, but you need to switch back and forth. Well, it is good that we pinpointed them. I think now we would need to put conditional tags on them so that it knows what to show depending on the language selected. I think you might need developer help for such a task or perhaps there is a better all around solution. Be sure to bump your topic so they can see you. Thanks, Bryan

#6 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 27 October 2010 - 05:41 AM

Yes, switching the language would be necessary, and the qtranslate does a pretty good job of it, apart from those few terms that are an issue here. Some developer help would really be appreaciated if that's the way to do it, and just translating the theme's po file and doing the rest as I've described doesn't get the job done.

#7 arpowers

arpowers

    Founder

  • Administrators
  • 3254 posts

Posted 27 October 2010 - 05:59 AM

Jaana, Are the strings you're talking about in the file you translated?

#8 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 27 October 2010 - 09:14 PM

Andrew, 'Go to top' is there, also 'Comments' and 'One Response to %2$s' are in the original Station.po file, but the file i regenerated is missing at least the last one, both are missing the plural 'responses' (as would be used in 'nn responses to').

#9 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 28 October 2010 - 02:11 AM

Bump again later tonight (the latest you're on) for the developers to see you in the morning. Don't want to bury your topic :). Thanks, Bryan

#10 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 29 October 2010 - 03:48 PM

Haven't had time to come round and bump this, but I'm still looking for a solution! :-)

#11 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 29 October 2010 - 08:40 PM

So the information is being lost once you regenerate the file? Are there settings when you do this where you decide what functions get translated? e.g. __ vs. _e or _n

#12 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 30 October 2010 - 12:43 PM

Yes, some of it is lost, but not everything, and the problem is that nothing is translated as far as I can see. The parts of the theme that are translated at the moment have been translated manually in the php files, probably completely wrong but as long as it works... :-) As far as I can remember, I used __, _e and something else but not quite sure anymore and don't have time to check it now - and like I said, the problem is that nothing is translated so it's probably something else I'm doing wrong.

#13 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 01 November 2010 - 04:36 PM

Did you look up resources on how to properly generate a .po/.mo file? There are many others besides __, _e, _n, and even expressions like gettext Also, did you use a plugin to generate the file or did you do it manually. A plugin might have that stuff built-in

#14 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 02 November 2010 - 07:52 PM

No, I didn't use other ones it seems, as those were the ones I was able to find on the Wordpress Codex instructions page (which only has __ and _e) and a couple of other places I checked. Any ideas where I should look for additional ones? I used poedit to generate the files.

#15 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 02 November 2010 - 10:13 PM

Well definitely regenerate the file and add _n as that will translate functions that have multiple scenarios e.g. comment count for zero, one, and multiple.

#16 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 12 November 2010 - 09:02 PM

Jaana, Did you end up resolving this issue? I'm curious as it would help future users

#17 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 20 November 2010 - 02:46 AM

Hi, afraid not (sorry for the long silence, I've been away). I'm still not able to generate a file that would include phrases like 'One Response to %2$s', 'responses' etc. I used __, gettext, gettext_noop, _n, _vs, _e to generate the file. Also, the original main problem still remains, which is that nothing is translated when I add the fi_FI files into the languages folder, not even the phrases that are there. So even if I eventually manage to generate a file with all the phrases, how do I get the theme to use the translated file...?

#18 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 22 November 2010 - 07:20 PM

I'll try going through the process today to see if I can troubleshoot it.

#19 andulka

andulka

    Super Member

  • Members
  • PipPipPipPip
  • 159 posts

Posted 23 November 2010 - 12:38 AM

That would be great, thanks! I'm beginning to think the problem with nothing being translated may have something to do with the zTranslate language switcher plugin. I tested changing the NextGen Gallery language and it doesn't work either (I tested with the included German file before going into the trouble of translating the language file). It would be nice to have the 'show as slideshow' and 'photos' translated, but they remained in English after switching the language into German (after first having enabled it on zTranslate). The locale it uses should be the standard fi_FI, and it works with some other plugins, so I can't imagine where the problem could be... At the moment I'm more or less stuck with zTranslate as some band members are used to using it on their previous record company sites and I haven't been able to find an alternative that would work more or less in the same way.

#20 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 23 November 2010 - 10:56 AM

Forwarding to developers just to make sure it stays fresh. Thanks, Bryan