This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

sellbuyrent me

  • ***
  • 36 posts
how add language switcher on the theme
« on: June 14, 2022, 02:20:46 PM »
how add language switcher on the theme or widget code which should be?

*

MB Themes

Re: how add language switcher on the theme
« Reply #1 on: June 14, 2022, 03:37:31 PM »
Just create link with following format:
Code: [Select]
<?php echo osc_base_url(); ?>language/{xy_AB}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

sellbuyrent me

  • ***
  • 36 posts
Re: how add language switcher on the theme
« Reply #2 on: June 16, 2022, 12:50:21 PM »
which folder and file i should insert it plz
i try to insert this code  also:
  <div class="langs">
        <?php if ( osc_count_web_enabled_locales() > 1) { ?>
          <?php $current_locale = mb_get_current_user_locale(); ?>

          <?php osc_goto_first_locale(); ?>
          <?php while ( osc_has_web_enabled_locales() ) { ?>
            <a class="lnk lang <?php if (osc_locale_code() == $current_locale['pk_c_code']) { ?>active<?php } ?>" href="<?php echo osc_change_language_url(osc_locale_code()); ?>"><img src="<?php echo osc_current_web_theme_url();?>images/country_flags/large/<?php echo strtolower(substr(osc_locale_code(), 3)); ?>.png" alt="<?php _e('Country flag', 'beta');?>" /><span><?php echo osc_locale_name(); ?>&#x200E;</span></a>
          <?php } ?>
        <?php } ?>
      </div>
where to plz?

*

MB Themes

Re: how add language switcher on the theme
« Reply #3 on: June 16, 2022, 12:55:53 PM »
@sellbuyrent
If you do not know file, how will you style it etc? Such question should not be asked. You place it where you need it, header.php or footer.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

sellbuyrent me

  • ***
  • 36 posts
Re: how add language switcher on the theme
« Reply #4 on: June 16, 2022, 01:01:10 PM »
@sellbuyrent
If you do not know file, how will you style it etc? Such question should not be asked. You place it where you need it, header.php or footer.php
i did insert in those files and its not working all design has disappeared

*

mwindey

  • *****
  • 461 posts
Re: how add language switcher on the theme
« Reply #5 on: June 16, 2022, 01:24:55 PM »

*

MB Themes

Re: how add language switcher on the theme
« Reply #6 on: June 16, 2022, 05:42:29 PM »
@sellbuyrent
You might broke PHP.

@mwindey
That is old-school music style  ??? ::) :'(
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

sellbuyrent me

  • ***
  • 36 posts
Re: how add language switcher on the theme
« Reply #7 on: June 16, 2022, 06:35:53 PM »
no i found out how to fix wit ur supportative  old song . thnaks walla
secpnd question plz: i try to translate out the theme with Poedit
i do translate files theme.po from en_Us of the theme folder
then i saving as Theme.po and upload this in de_De folder (new langauage ) and its nothing translate when i switch the lanaguage
what is wrong plz any idea?
regards

*

MB Themes

Re: how add language switcher on the theme
« Reply #8 on: June 17, 2022, 02:57:33 PM »
Osclass use .mo file as source of translation. Best practice is to keep both files.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

sellbuyrent me

  • ***
  • 36 posts
Re: how add language switcher on the theme
« Reply #9 on: June 18, 2022, 11:13:44 AM »
enno ofcourse we do keep both files walaw and still not translated . for guys whom facing same problem - there is other forums review this problems so the problems is with updating theme and different number of line's code...need be checking up those file which is refers to lanaguages . regards

Marked as best answer by frosticek on June 29, 2022, 08:12:34 PM
*

sellbuyrent me

  • ***
  • 36 posts
Re: how add language switcher on the theme
« Reply #10 on: June 20, 2022, 02:01:34 PM »
also as insctuction osclass said check with table t_locale and make sure language code (pk_c_code) ashould same even letter capital or not capital

*

MB Themes

Re: how add language switcher on the theme
« Reply #11 on: June 29, 2022, 08:12:22 PM »
Code references in .PO files are informal only. Also PO without referencing in code will work
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: how add language switcher on the theme
« Reply #12 on: June 29, 2022, 08:13:04 PM »
also as insctuction osclass said check with table t_locale and make sure language code (pk_c_code) ashould same even letter capital or not capital

Yes, it must match and is case sensitive, xx_YY
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots