1. Osclass Forum
  2. General
  3. Language change code

Language change code

Started by 7ala, March 30, 2021, 7:29 pm

  • 1

7ala

Language change code

on :March 30, 2021, 7:29 pm #424

welcome everybody
Please
Multilingual site Most of the sites link change the language in this way
http: // localhost / en
http: // localhost / ru
And so on
But osclass Different I couldn't access the language change code

I try
& lang = en_US '

& lang = ru_RU '
Unfortunately, it is unsuccessful
How to get the language link
Thank you


calinbehtuk

Re: Language change code

on :March 30, 2021, 7:37 pm #425

Osclass is translated in different way, you can't achieve that here.

7ala

Re: Language change code

on :March 31, 2021, 8:55 am #426

thank you for replying


But what I mean is how this works


<a href="<?php echo osc_item_url_ns(osc_item_id());?>&lang=en_US"></a>


<a href="<?php echo osc_item_url_ns(osc_item_id());?>&lang=ru_RU"></a>


Because the code is only on the product attribute


On the home page does not work

calinbehtuk

Re: Language change code

on :March 31, 2021, 12:59 pm #427

Bender theme

Code: [Select]
​<?php if ( osc_count_web_enabled_locales() > 1) { ?>
            <?php osc_goto_first_locale(); ?>
            <strong><?php _e('Language:', 'bender'); ?></strong>
            <?php $i = 0;  ?>
            <?php while ( osc_has_web_enabled_locales() ) { ?>
            <span>
<a id="<?php echo osc_locale_code(); ?>" href="<?php echo osc_change_language_url ( osc_locale_code() ); ?>">
<?php echo osc_locale_name(); ?>
</a>
</span>
<?php if( $i == 0 ) { echo " &middot; "; } ?>
                <?php $i++; ?>
            <?php } ?>
<?php } ?>


A link


Code: [Select]
​<a href="<?php echo osc_change_language_url ('en_US'); ?>">English</a>


7ala

Re: Language change code

on :March 31, 2021, 8:50 pm #428

You are gorgeous


Thank you Now it works


But with fixed pages the same problem


I tried this


        <a href="<?php echo osc_static_page_url ('en_US'); ?>"></a>


        <a href="<?php echo osc_static_page_url ('ru_RU'); ?>"></a>


Thank you again.


calinbehtuk

Re: Language change code

on :April 16, 2021, 10:44 am #429

Single pages aren't translated. In a single page the content is not translated like is on item for example. Only the text from theme, plugins an core are translated if this text has a translation set in the language folder.

vladan

Re: Language change code

on :July 3, 2022, 5:48 pm #625

Hello!

Can i ask for solution for article and categories title and text content language?

I made new file for translate blog, but need text on more languages.

Thank you

  • 1
Subscribe
X

Subscribe!

Subscribe to get the latest listings, updates and special offers delivered directly in your inbox.