Product Updates
Joomla 5.2.3 Compatibility for JA Templates, Bug Fixes, and More

The JomSocial country field isn't translating the values correctly, and viewing the language file itself the constants are not correct either.
1. Screenshot of creating the field: https://snipboard.io/aP7TLf.jpg
2. Screenshot of the created field on frontend: https://snipboard.io/AKfDV1.jpg
3. Screenshot of the browser console for the field: https://snipboard.io/6YsjBv.jpg
4. Screenshot of the loaded language file: https://snipboard.io/f82qko.jpg
5. Screenshot of the language file, showing the correct values for the country select: https://snipboard.io/bipof8.jpg

    quasiman
    Hi
    Kindly edit fields in first post and submit a temp super user login and FTP details for staff.

    Regards

      Ninja
      Edited the first post with details of a new site with no modifications other than the country field added.

        Ninja
        The issue has not been resolved on the test site, and the language file has not been changed. What changes need to be applied?

          Ninja
          I apologize if I'm not being clear on the issue, so let me try again...

          I do not need to translate the file, as the site is defaulted to English ( en-GB ), and the language debug shows that the file loaded. The problem is that the select option values are not displaying the English file constants:

          These option values are NOT correct; they should show the values for the language codes:
          COM_COMMUNITY_LANG_CODE_AF="AF"

            quasiman
            Hi
            Its normal the select option load the html code and value is picked. its work like this.

              Ninja
              It's normal that the code does not use its own language file information? I don't understand that....

              Is there a way I can create my own field without hacking the code that correctly uses the two letter country codes?

                quasiman
                Hi
                what you mean the code not using own language?
                The site default language is EN and same is used on your site, what you want to change?
                the select option use the code constants and loads the values from language file.

                  Ninja

                  The two letter country codes are not being used from the language file.

                  Currently it is like this:
                  <option value="COM_COMMUNITY_LANG_NAME_AFGHANISTAN">Afghanistan</option>
                  <option value="COM_COMMUNITY_LANG_NAME_ALANDISLANDS">Åland Islands</option>
                  <option value="COM_COMMUNITY_LANG_NAME_ALBANIA">Albania</option>

                  I want it to be like this:
                  <option value="COM_COMMUNITY_LANG_CODE_AF">Afghanistan</option>
                  <option value="COM_COMMUNITY_LANG_CODE_AX">Åland Islands</option>
                  <option value="COM_COMMUNITY_LANG_CODE_AL">Albania</option>

                    quasiman
                    Hi

                    COM_COMMUNITY_LANG_NAME_AFGHANISTAN

                    this is the value used to get the country name it would not change.

                      Ninja
                      Right, and that's my point. Why is the value in the language file not being used?
                      COM_COMMUNITY_LANG_CODE_AF

                        quasiman
                        Hi
                        I do not understand what you mean why its not used, the selection code use the default code, this is how it works

                        The language file has these two values... why isn't the select using both?

                        COM_COMMUNITY_LANG_NAME_AFGHANISTAN="Afghanistan"
                        COM_COMMUNITY_LANG_CODE_AF="AF"

                        By the way, the change to use Country Code is very simple:
                        /components/com_community/libraries/fields/country.php
                        `

                          quasiman
                          Hi
                          Yes its in the core the used to pick the country values, however its not something issue even if you use the same default code.

                            Ninja
                            My problem is that I need the two letter code for a plugin I'm writing.

                            The two letters codes are in the xml and the language file, why not use them?

                              quasiman
                              Hi
                              because you can use One at a time and default is used as Main code.

                              You need to Login to view replies.