Results 1 to 1 of 1

Thread: ACFCP and WPML - must read!

  1. #1
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Russian Federation
    Thanked 593 Times in 491 Posts

    ACFCP and WPML - must read!

    Hi, Guys and Girls!

    Am pleased to report excellent news! ACFCP v2.3.1 compatible with WPML!
    Many thanks to @covoiturage for persistence and patience. Thanks to him, compatibility with WPML is included in this version.

    So, what you can and what not.

    You can:

    1. Translate profile field labels;
    2. Translate profile field descriptions;
    3. Translate even values (but only for drop-downs, checkboxes and radios);
    4. Translate validation messages;
    5. Translate datepicker ("how to" read below)

    With ACFCP you can't:
    1. Translate Ad fields (values, labels, descriptions, tooltips) - provided by ClassiPress - and don't ask me about it!!!!
    2. Translate Profile text/textarea field values. I'm not sure it's expediently and not sure that WPML in the end did not ruin your server. But if you insist - I give you this at your own risk, without any guarantees.

    How to translate Datepicker:
    The problem is that the Datepicker translation does not pass through php at all. And it can't be translated through WPML and other gettext stuff. Datepicker works through javascript and loads own localization files directly to your browser. All we can - translate js localization file name. Cool workaround!

    Go to back-end -> WPML String Translation -> Select strings within context: acfcp -> find row with name 'js_lang_code_[default-datepicker-language-code]'
    Where 'default-datepicker-language-code' - locale, which you set on ACFCP Datepicker settings tab. By default 'en-GB'.
    Now you need translate this language code to appropriate javascript code.
    Keep In mind: php language code may not be the same to JS language code.

    Below you see list of js codes, which you should specify as translation:
    'af'    => 'Afrikaans','sq'    => 'Albanian (Gjuha shqipe)',
    'ar-DZ' => 'Algerian Arabic',
    'ar'    => 'Arabic (‫(لعربي',
    'hy'    => 'Armenian (Հայերեն)',
    'az'    => 'Azerbaijani (Azərbaycan dili)',
    'eu'    => 'Basque (Euskara)',
    'bs'    => 'Bosnian (Bosanski)',
    'bg'    => 'Bulgarian (български език)',
    'ca'    => 'Catalan (Català)',
    'zh-HK' => 'Chinese Hong Kong (繁體中文)',
    'zh-CN' => 'Chinese Simplified (简体中文)',
    'zh-TW' => 'Chinese Traditional (繁體中文)',
    'hr'    => 'Croatian (Hrvatski jezik)',
    'cs'    => 'Czech (čeština)',
    'da'    => 'Danish (Dansk)',
    'nl-BE' => 'Dutch (Belgium)',
    'nl'    => 'Dutch (Nederlands)',
    'en-AU' => 'English/Australia',
    'en-NZ' => 'English/New Zealand',
    'en-GB' => 'English/UK',
    'eo'    => 'Esperanto',
    'et'    => 'Estonian (eesti keel)',
    'fo'    => 'Faroese (føroyskt)',
    'fa'    => 'Farsi/Persian (‫(فارسی',
    'fi'    => 'Finnish (suomi)',
    'fr'    => 'French (Français)',
    'fr-CH' => 'French/Swiss (Français de Suisse)',
    'gl'    => 'Galician',
    'ge'    => 'Georgian',
    'de'    => 'German (Deutsch)',
    'el'    => 'Greek (Ελληνικά)',
    'he'    => 'Hebrew (‫(עברית',
    'hi'    => 'Hindi (हिंदी)',
    'hu'    => 'Hungarian (Magyar)',
    'is'    => 'Icelandic (Õslenska)',
    'id'    => 'Indonesian (Bahasa Indonesia)',
    'it'    => 'Italian (Italiano)',
    'ja'    => 'Japanese (日本語)',
    'kk'    => 'Kazakhstan (Kazakh)',
    'km'    => 'Khmer',
    'ko'    => 'Korean (한국어)',
    'lv'    => 'Latvian (Latvieöu Valoda)',
    'lt'    => 'Lithuanian (lietuviu kalba)',
    'lb'    => 'Luxembourgish',
    'mk'    => 'Macedonian',
    'ml'    => 'Malayalam',
    'ms'    => 'Malaysian (Bahasa Malaysia)',
    'no'    => 'Norwegian (Norsk)',
    'pl'    => 'Polish (Polski)',
    'pt'    => 'Portuguese (Português)',
    'pt-BR' => 'Portuguese/Brazilian (Português)',
    'rm'    => 'Rhaeto-Romanic (Romansh)',
    'ro'    => 'Romanian (Română)',
    'ru'    => 'Russian (Русский)',
    'sr'    => 'Serbian (српски језик)',
    'sr-SR' => 'Serbian (srpski jezik)',
    'sk'    => 'Slovak (Slovencina)',
    'sl'    => 'Slovenian (Slovenski Jezik)',
    'es'    => 'Spanish (Español)',
    'sv'    => 'Swedish (Svenska)',
    'ta'    => 'Tamil (தமிழ்)',
    'th'    => 'Thai (ภาษาไทย)',
    'tj'    => 'Tajikistan',
    'tr'    => 'Turkish (Türkçe)',
    'uk'    => 'Ukranian (Українська)',
    'vi'    => 'Vietnamese (Tiếng Việt)',
    'cy-GB' => 'Welsh/UK (Cymraeg)'

    Your site uses three languages: English, French and French/Swiss. (just example!)
    By deafult English.

    Go to back-end -> WPML String Translation -> Select strings within context: acfcp -> find row with name 'js_lang_code_en-GB'.
    Translate this string to other languages:
    French -> fr
    French/Swiss -> fr-CH

    If you did it correctly - you get translated Datepicker!

    Thats all for now!

    Good Luck! - AppThemes plugins, tutorials, modifications and services

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

    By dikiyforester in forum Advanced Custom Fields
    Replies: 27
    Last Post: February 15th, 2014, 04:10 AM
  2. ACFCP & DMLF's
    By bleem in forum ACF :: Hyperlink
    Replies: 1
    Last Post: August 8th, 2013, 11:39 AM
  3. One's read something about BlueHost and them closing your website. Please Read
    By cuso10 in forum ClassiPress General Discussion
    Replies: 8
    Last Post: June 22nd, 2013, 12:14 AM
  4. ACFCP and DMLF
    By nayyer in forum Advanced Custom Fields
    Replies: 18
    Last Post: May 15th, 2013, 08:50 AM
  5. ACFCP 1.1 New Features
    By bighenry in forum Advanced Custom Fields
    Replies: 8
    Last Post: November 10th, 2012, 04:40 AM