Osclass Support Forums
General osclass questions => General discussion => Topic started by: sellbuyrent me on June 14, 2022, 02:20:46 PM
-
how add language switcher on the theme or widget code which should be?
-
Just create link with following format:
<?php echo osc_base_url(); ?>language/{xy_AB}
-
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(); ?>‎</span></a>
<?php } ?>
<?php } ?>
</div>
where to plz?
-
@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
-
@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
-
Always remember: https://www.youtube.com/watch?v=AqrxgEln_Dw
:D ;) ;)
-
@sellbuyrent
You might broke PHP.
@mwindey
That is old-school music style ??? ::) :'(
-
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
-
Osclass use .mo file as source of translation. Best practice is to keep both files.
-
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
-
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
-
Code references in .PO files are informal only. Also PO without referencing in code will work
-
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