osclass / Osclass

With Osclass, get your own classifieds site for free. Build your own Osclass installation and start advertising real estate, jobs or whatever you want- in minutes!
http://osclass.org/
649 stars 342 forks source link

child theme translations issue #1879

Open garciademarina opened 9 years ago

garciademarina commented 9 years ago

Once a child theme is activated, parent translations are missed.

We need to load parent translations with parent domain. this way we are loading both translations, parent and child translations.

for example: ( Translation-> __construct ) $theme_file = osc_themes_path() . 'bender/languages/' . $locale . '/theme.mo'; $this->_load($theme_file, 'bender');

ghost commented 9 years ago

Hi! I created a theme bender_child, is now not working Russian translation. Where to insert this code?

phox081 commented 9 years ago

Is there a solution?

ghost commented 9 years ago

Has created your own theme, bender-my-theme Working properly

:) Sorry for bad english

gaissa commented 8 years ago

So... any good solution to this?

vlazic commented 7 years ago

Our solution was to replace line 52 in os-includes/osclass/core/Translation.php from: $domain = osc_theme(); to: $domain = str_replace('_child', '', osc_theme());

our child theme is named 'gum_child'. We don't like this solution because we need to manually change it after every update.

pocapratica commented 7 years ago

Hi @vlazic The line 52 is different in version 3.7.3 It's like: $domain = osc_apply_filter('theme', osc_theme()); I tried to change to: $domain = osc_apply_filter('theme', str_replace('_child', '', osc_theme())); but nothing happened, so I tried: $domain = str_replace('_child', '', osc_theme()); and nothing happened too.

My child theme is azzurro_child

Can anybody help us? I think this is a bug.

IDEA: Do you think the problem is that the translate function <?php _e("<strong>Search</strong> for it:", 'azzurro') ; ?> don't work because it opens the translation file in the main theme? Or not? IF I replace all the azzurro to azzurro_child and copy the translation folder to my child it will work??

Similambda commented 6 years ago

My solution for translate osclass child theme is similar like @pocapratica, work for: Osclass 3.7.4 Theme: bender Child Theme: bender_child

Open file: os-includes/osclass/core/Translation.php

Find line: 52, there is code like: $domain = osc_apply_filter('theme', osc_theme()); ad below (or instead) this line paste code: $domain = osc_apply_filter( 'theme', str_replace('_child', '', osc_theme()) );

Refresh site - should work. Remember about cache - sometimes hosting has cache, and you should clear this to see changes, or you have wait e.g. 5 minutes.

Remeber - you should do this solution every update osclass!

avs-code commented 5 years ago

Hi, I have osclass 3.8 and @Similambda & @vlazic fix not work to me, main.css header background color neither in child theme (in parent is working). When this could be fixed? thanks!