Advertisement:

Author Topic: Translations from 1 file  (Read 1958 times)

TheSiege

  • Newbie
  • *
  • Posts: 5
Translations from 1 file
« on: August 19, 2011, 09:20:19 pm »
I'm translating my osClass installation to a regional language which doesn't have an official translation yet. A lot of echo's are hardcoded into the php files themselves. Those should also be in the translation file so I don't have to go down every php file to see if there's a line in there.

TriLoGuE

  • Newbie
  • *
  • Posts: 35
Re: Translations from 1 file
« Reply #1 on: August 19, 2011, 10:17:05 pm »
That would be great because I need to have it multilingual and this is due to the fact that not all parts are located in those language files :-/ This is the biggest drawback at the moment ...

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Translations from 1 file
« Reply #2 on: August 22, 2011, 01:09:14 pm »
@TriLoGue: which parts are not located?

The only part that is not located is the installation process. Maybe I'm wrong, can you tell me where is not located?

TheSiege

  • Newbie
  • *
  • Posts: 5
Re: Translations from 1 file
« Reply #3 on: August 22, 2011, 06:43:59 pm »
In main.php I found this:

Code: [Select]
<div class="latest_ads">
                        <h1><strong><?php _e('Latest Items''modern') ; ?></strong></h1>
                        <?php if( osc_count_latest_items() == 0) { ?>
                            <p class="empty"><?php _e('No Latest Items''modern') ; ?></p>
                        <?php } else { ?>
                            <table border="0" cellspacing="0">

Ideally, those 2 lines should be included in the translation file. I'm trying to make a bi-lingual site and I can't do that when it isn't part of the translation file. And there's many like it scattered around a typical theme file.
« Last Edit: August 22, 2011, 06:55:58 pm by TheSiege »

TriLoGuE

  • Newbie
  • *
  • Posts: 35
Re: Translations from 1 file
« Reply #4 on: August 23, 2011, 11:49:11 am »
Hi,

you even describe in your Wiki how to change some messages in the .php file ;-) There are some more if you look into different themes.

Take care

Marc

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Translations from 1 file
« Reply #5 on: August 23, 2011, 03:16:40 pm »
In main.php I found this:

Code: [Select]
<div class="latest_ads">
                        <h1><strong><?php _e('Latest Items''modern') ; ?></strong></h1>
                        <?php if( osc_count_latest_items() == 0) { ?>
                            <p class="empty"><?php _e('No Latest Items''modern') ; ?></p>
                        <?php } else { ?>
                            <table border="0" cellspacing="0">

Ideally, those 2 lines should be included in the translation file. I'm trying to make a bi-lingual site and I can't do that when it isn't part of the translation file. And there's many like it scattered around a typical theme file.

It should appear translated. If it's not translated, it's because the translation file is not ok. Which language are you using?

Hi,

you even describe in your Wiki how to change some messages in the .php file ;-) There are some more if you look into different themes.

Take care

Marc

We'd had issues with "Select category" string and a couple more. However, it should work fine now. In addition, the translation you download only applies to modern theme, if you use another theme you should use their translation files.

TriLoGuE

  • Newbie
  • *
  • Posts: 35
Re: Translations from 1 file
« Reply #6 on: August 23, 2011, 03:25:26 pm »
Well I guess this is the problem, as soon as you use another theme all the translation is again trashed. There should be a rule that you have to use only one file located in the core of OSclass instead of having 20 different files in 20 different locations ;-)

But I guess we gettin' there sometime. I'm working already on a proper German translation because the existing one is ... lets say trash :-)

Take care

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Translations from 1 file
« Reply #7 on: August 23, 2011, 03:34:43 pm »
Well, the translation files of the theme are inside the theme... I think that it's normal because each theme can have different strings.

TriLoGuE

  • Newbie
  • *
  • Posts: 35
Re: Translations from 1 file
« Reply #8 on: August 23, 2011, 03:45:08 pm »
Sadley true but in general all strings that are used by the OSclass should be used from software files. as it is right now you can't use OSclass for multilingual web-pages. I'm testing right now the modern and the BCute theme and even the standard strings are not used in German as they should.

For instance if you look at the first page in the modern theme it's written: "Wähle deine Kategorie" and in BCute you can find the English string: "select a category" this is a bit odd. Maybe there should be a rule for that "theme translation thing" ;-)

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Translations from 1 file
« Reply #9 on: August 23, 2011, 03:52:37 pm »
Well, the rule is that you have to generate the .po translation file of the theme and place the file in ./oc-content/themes/{theme_name}/languages/{language_code}/theme.mo (it's a compiled file generated with poedit). This is the reason why bcute is showing "Select a category". It's not very different of how Drupal, Wordpress and other software works.

About the translation, if you want to help to correct the german translation, tell me and I'll create a new account to you in admin.osclass.org

TriLoGuE

  • Newbie
  • *
  • Posts: 35
Re: Translations from 1 file
« Reply #10 on: August 23, 2011, 03:58:27 pm »
I understand your rule but maybe it's easier to have the language file somewhere in the core located instead of the theme. Would make everything much more easy for everyone.

About the translation, if you want to help to correct the german translation, tell me and I'll create a new account to you in admin.osclass.org

I got already the login from you ;-)

TheSiege

  • Newbie
  • *
  • Posts: 5
Re: Translations from 1 file
« Reply #11 on: August 24, 2011, 01:48:00 am »
Well, the rule is that you have to generate the .po translation file of the theme and place the file in ./oc-content/themes/{theme_name}/languages/{language_code}/theme.mo (it's a compiled file generated with poedit). This is the reason why bcute is showing "Select a category". It's not very different of how Drupal, Wordpress and other software works.

About the translation, if you want to help to correct the german translation, tell me and I'll create a new account to you in admin.osclass.org

A lot of the same lines are used throughout all the themes. Wouldn't it be easier to make a general language template and to let the theme make a seperate template for everything that isn't in the core language template? This would save translators a whole lot of work.

It should appear translated. If it's not translated, it's because the translation file is not ok. Which language are you using?

It isn't. I'm using the BCute theme and using the Dutch translation file from the site installed and enabled from the admin panel. It does work in the modern theme but it doesn't in any other theme.
« Last Edit: August 24, 2011, 01:51:25 am by TheSiege »

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Translations from 1 file
« Reply #12 on: August 24, 2011, 01:27:22 pm »
Which version of the dutch translation are you using?

TheSiege

  • Newbie
  • *
  • Posts: 5
Re: Translations from 1 file
« Reply #13 on: August 24, 2011, 02:29:53 pm »
Which version of the dutch translation are you using?

Index says 2.1