• Resolved Xandro

    (@sudarshankotian)


    Hi, @dragosvrejiu

    I am trying to build my own webapp without any plugins, so can you please let me know how to setup language issue for webapps having multiple languages?

    Like default is English for which obviously I have to setup language as English in site.webmanifest. But how can we trigger it for French user?

    Do I need to translate this file > site.webmanifest? will it help? if yes, how should I do it?

    Thanks, in advance… ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Alex

    (@alexcozmoslabs)

    Hi,

    Our plugin works only in the WordPress environments.

    Basically, the language switcher consists of a series of anchor tags with href attributes pointing to the equivalent page in different languages.

    You can find the code for the already-built language switchers here:

    1. Floater language switcher
    wp-content/plugins/translatepress/includes/class-language-switcher.php (function add_floater_language_switcher)
    wp-content/plugins/translatepress/assets/css/trp-floater-language-switcher.css

    ?2. Shortcode language switcher [language_switcher]
    wp-content/plugins/translatepress/includes/class-language-switcher.php ( function language_switcher )
    wp-content/plugins/translatepress/partials/language-switcher-shortcode.php
    wp-content/plugins/translatepress/assets/css/trp-language-switcher.css

    Use the code as an example of how to build a language switcher.

    But again, if you are planning to do something external to WordPress, we don’t have support.

    • This reply was modified 2 years, 1 month ago by Alex.
    • This reply was modified 2 years, 1 month ago by Alex.
    Thread Starter Xandro

    (@sudarshankotian)

    Hi, @alexcozmoslabs I understand that.

    But since I was using this plugin, I thought I should ask here.

    I was going through your plugin documentations here

    Can we just use this code >

    <?php
        $current_language = get_locale();
    
        if( $current_language == 'en_EN' ){
          echo 'text in language en_EN';
        }
        
        if( $current_language == 'fr_FR' ){
          echo 'text in language fr_FR';
        }
        
    ?>

    For manifest file URL? To call on specific <html lang=”ms-MY” language user accesses?

    Thank you.

    Plugin Support Alex

    (@alexcozmoslabs)

    That code is to displays different content for different languages while using TranslatePress on a WordPress environment.

    If you still have questions, please open a new ticket.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translation support for webapp with Translatepress’ is closed to new replies.