• Resolved perdittmann

    (@perdittmann)


    Hello Falang team,
    I am setting up a WordPress website that is supposed to be bilingual English/Faroese.
    I was thrilled to find “F?royskt” in your languages file (/wp-content/plugins/falang/includes/languages.php), but disappointed not to find the language included in the “Choose a language” dropdown menu under “Add new language”. Is there something I am missing? Or do I have to take additional steps to activate F?royskt support?

    Many thanks in advance for your help!
    Per Dittmann


    P.S. The contact form on https://www.faboba.com/en/contact.html is broken. The captcha is not accepted, regardless of what is entered.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author sbouey

    (@sbouey)

    Hi,

    Falang support the language supported by WordPress , here is a list from Astra documenation https://wpastra.com/docs/complete-list-wordpress-locale-codes/

    I don’t know this F?royskt language, the WordPress language is important to display all the system and plugin message. But perhaps this language is very close to another more used language and you can use it. Just use your own sef and image for the switcher it will work.

    Thanks for the message about my contact page , i have changed it 2 days ago due to a lot of spam. and forget to test it.

    Best regards,

    Stéphane

    Thread Starter perdittmann

    (@perdittmann)

    Okay, that’s great! In that list, right above “Finnish” is “Faroese” (F?royskt in Faroese, I am sorry for the confusion).
    How do I make it appear in the “Add new language” dropdown list? What does “use your own sef” mean?
    I don’t need a separate image, it’s all there – image and everything, it’s just not in the dropdown.

    Plugin Author sbouey

    (@sbouey)

    Hi,

    Sorry forgett my last response it was not good. thanks to @rob who write me about that.

    You’re problem was quite the same with this one https://www.ads-software.com/support/topic/custom-language-7/

    This mean you have to use use this code in your function.php of your template

    add_filter( 'falang_predefined_languages', function( $languages ) {
    
      if ( !array_key_exists( 'mi_NZ', $languages ) ) {
    
        $languages[ 'fo' ] = 
          array ( 'code' => 'fo',
                  'locale' => 'fo',
                  'name' => 'Faroese',
                  'dir' => 'ltr',
                  'flag' => 'fo',
                  'facebook' => 'fo_FO' );
    
        return $languages;
      }
    } );

    but the problem after that will be the message “The language was created, but the WordPress language file was not downloaded. Please install it manually.”

    It’s why Falang don’t display the language in the dropdown because it’s not fully supported by WordPress, i use the function

    $translations = wp_get_available_translations();

    you have a documentation here to add manually a language https://www.hostpapa.com/knowledgebase/change-wordpress-language/

    Stéphane

    Thanks Stéphane for typing the scattered info I sent and putting it in the correct order. Only the first line needs to be adapted (NOT mi_NZ):

    add_filter( 'falang_predefined_languages', function( $languages ) {
    
      if ( !array_key_exists( 'fo', $languages ) ) {
    
        $languages[ 'fo' ] = 
          array ( 'code' => 'fo',
                  'locale' => 'fo',
                  'name' => 'Faroese',
                  'dir' => 'ltr',
                  'flag' => 'fo',
                  'facebook' => 'fo_FO' );
    
        return $languages;
      }
    } );

    Hi (@perdittmann,

    Falang has automatic recognition for all WP completely translated languages. But Faroese is only 18% finished for WP 6.2, that’s what causes it not to appear in the dropdown.

    There are two ways to get it in the dropdown, either use the code given above in your (child theme) functions.php. Then add the fo_FO.mo file later to WP.

    Or second method is to first download the .po and .mo files, put them in the WP languages folder, then your language will appear in the Falang dropdown automatically.

    1. Go to the WordPress translation website.
      https://make.www.ads-software.com/polyglots/teams/
      Scroll down to the Translation Teams section and find the language you want to install.
    2. Click on the percent complete value.
      https://translate.www.ads-software.com/locale/fo/default/wp/dev/
      In the Set / Sub Project column, click the WordPress version number for your installation.
      If you see the Development status, the translation hasn’t completed testing, but you can download it.
    3. Scroll down to the export settings and choose all current as Machine Object Message Catalog (.mo) as the export file type.
      Click Export to get the .mo file downloaded (also export as .po if you want to do editing of the lang).
      Rename both to fo_Fo.mo and fo_FO.po
    4. Put these files in the folder wp-content/languages

    Done

    Thread Starter perdittmann

    (@perdittmann)

    Thank you for your kind support. It is good to know why I got stuck, and how to remedy that.

    For the moment, I settled on an alternative solution (the not exactly complex site structure allowed me to code a language switcher myself). But should the site grow in the future, I am glad to know a tool that’ll work for me.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Support for Faroese language?’ is closed to new replies.