• Hi people ??

    I’m developing a plugin that make use of google places api.
    I have a field address autocompleting with google places informations (city, country).

    Since that this site will support multilingual, i was thinking of store cities and countries in english, to ne translated then with a .pot file.

    Now… This pot file could be really difficoult to translate, and the one provided by WP doesn’t seem complete ( i was looking for italy and Milan but there wasn’t ).

    Is there another way i can resolve this?

    Thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Have you looked at I18n for WordPress Developers? The WP .pot file is only useful to you as an example, it only contains strings for translation that occur in the WP installation. As a plugin developer you need to create your own .pot file, which translators use to create .po files in their language. From the .po files, use the GetText package to generate .mo files that allow your plugin to display translated strings.

    The way the i18n facility works is not compatible for use in auto complete AFAICT. It works by looking up complete English strings and retrieving the appropriate translated string. The available functions are not capable of finding translated data based a few characters input by the user.

    However, that data IS there, it’s just that WP cannot find it in the way you want. If you can learn the format of the .mo file, you may be able to develop a custom search script that would find translated strings from partial user input. You would need to do this no matter what format the data is in or how it was created. It would be important the data be organized properly for efficient searching, I don’t know if .mo files meet this requirement or not.

    Thread Starter Sergio De Falco

    (@sgr33n)

    hi ??

    Thanks for your reply. I know how i18n works, I just wanted to know if there is another way than this, because translate every city and every country of the world could be a really long work. Doesn’t matter to me if it’s a pot file or an xml or a simple txt file, I just need a base file where to start… then I could convert it in .pot. I was thinking about Google Translation API, but unfortunately it’s a paid service ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cities & countries translation’ is closed to new replies.