1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Service Issue Tweet button localization

Discussion in 'Resolved Bug Reports' started by imthebest, May 10, 2015.

  1. imthebest

    imthebest Formerly Super120

    *It looks* like Twitter at the same time when they altered their CSS also changed their implementation because IIRC before this problem the "Tweet" button was being inserted in my language (spanish) as "Twittear" but now it is being inserted in english as "Tweet".

    Is this something that you can also control?
  2. Chris D

    Chris D XenForo Developer Staff Member

    I think we may need to look at this in more detail.

    We can (and do) sort of control it. Each language you have installed has a language code based on the "Locale", e.g. en-US is the default for English (US). es-LA is the default for Spanish, and es-MX is the default for Mexico Spanish, etc.

    We pass that language code into the Tweet button code.

    According to some Twitter documentation:

    The bit in bold, no longer seems to be true. If I set the language code to es-mx or es-MX (either case), then the button reads as "Tweet" as if rendering in US English. None of the Spanish locales in XenForo actually use the language code "es" on its own though if I force it to this then the button does get rendered in Spanish.
    Last edited: May 10, 2015
    Daniel Hood and imthebest like this.
  3. Mike

    Mike XenForo Developer Staff Member

    We can workaround this in some cases, but this does potentially break other cases. As their documentation says that this should be working, we have reported it as a bug to them so hopefully it will be fixed soon.
  4. Chris D

    Chris D XenForo Developer Staff Member

    This was indeed 100% down to a bug in Twitter but I have been told today by one of the Twitter developers that the issue has been fixed. Certainly in my testing it appears to work - the language codes we pass in to Twitter should render in the closest "parent" language, e.g. es-LA will resolve to "es"

    Here was an example that was showing the bug:

    You can now see the bottom two both correctly show the localized word.
    imthebest likes this.

Share This Page