OSClass user could choose a geographical location of the for-sale item. The list of regions changes according to the chosen country. And similarly, the cities menus changes according to the chosen region. While working on EE Classifieds, I noticed my translated locations did not appear at the choosing menus.
Work-around Client-Side Limitations
It turns out that the dynamic changing of list-items in response to user selections of country-region-city is implemented in AJAX. Browser-side script cannot access the server-side gettext() / PO translations. Therefore, I made some changes in the API so that the AJAX calls returns the translated string based on the current site language setting.
Specifically, the country-region-city lists are dynamically filled in Item.form.class.php. The list of cities and regions are retrieved in function location_javascript(). I modified the AJAX request such that it would request translated versions of the associated cities or regions. The corresponding AJAX-server-function, ajax.php:doModel(), is modified to serve these values accordingly, based on the current language setting.
It turns out that the dynamic changing of list-items in response to user selections of country-region-city is implemented in AJAX. Browser-side script cannot access the server-side gettext() / PO translations. Therefore, I made some changes in the API so that the AJAX calls returns the translated string based on the current site language setting.
Specifically, the country-region-city lists are dynamically filled in Item.form.class.php. The list of cities and regions are retrieved in function location_javascript(). I modified the AJAX request such that it would request translated versions of the associated cities or regions. The corresponding AJAX-server-function, ajax.php:doModel(), is modified to serve these values accordingly, based on the current language setting.