chitezh / woocommerce_states_places

Woocommerce plugin that lists states, cities, local government areas and towns
https://wordpress.org/plugins/states-cities-and-places-for-woocommerce
GNU General Public License v3.0
49 stars 140 forks source link

Add Saudi Arabia #51

Open ihelpco opened 4 years ago

ihelpco commented 4 years ago

Hi, I have a list of all cities of Saudi Arabia. Can you add it to your plugin? Thanks

theprodev commented 4 years ago

Hey, I can provide you an update including Saudi Arabia. Do you have a list of cities and regions in Saudia ready?

YordanSoares commented 4 years ago

Hello @ihelpco and @theprodev. Please refer the documentation about Adding a new country to send a pull request with your country.

Thanks in advance for contributor extending the supported countries.

ihelpco commented 4 years ago

Hello @YordanSoares and @theprodev. Is there a way to make the states and cities: English in backend and Arabic in frontend?

theprodev commented 4 years ago

@ihelpco. Yes, it seems possible. Should be no problem.

ihelpco commented 4 years ago

ok @theprodev , i will prepare a file in excel with the states and cities in Arabic and English. Is that what you need? Thanks for your help.

ihelpco commented 4 years ago

@theprodev , i tried this way but it displayed the Arabic city name in frontend and backend:

$places['SA'] = array( '01' => array( 'riyadh' => 'الرياض', 'buraidah' => 'بريدة', ),

YordanSoares commented 4 years ago

Hello @theprodev and @ihelpco. I just publish v1.2.5-dev-SA (pre-release) for testing purpose, including Saudi Arabia with translation feature (you can translate to Arabic using states-cities-and-places-for-woocommerce-es_SA.po file included in languages directory.

Can you test this pre-release and give me feedback about it?

Thanks in advance.

YordanSoares commented 4 years ago

Sorry, I just saw the correct filename to translation file should be states-cities-and-places-for-woocommerce-ar_SA.po instead states-cities-and-places-for-woocommerce-es_SA.po.

Please update to apply your translation. You should to have your WordPress language set in Algerian language to apply it.

ihelpco commented 4 years ago

Awesome, It is working as expected. HUGE Thanks. I could translate the states and cities successfully.

One more thing, can we make the cities appear like this: Frontend: Translated according to site language. (ex. Arabic for Arabic sites and English for English sites) Backend: ALWAYS English.

Because ARAMEX and all other Shipping Carriers require the city name to be English so that it can calculate the shipping rates in checkout page, and you can prepare shipment using the official "Aramex Shipping WooCommerce Plugin" from the edit order page.

As you can see, the city name is Arabic but I need it to be always English regardless of the site language:

Screen Shot 2020-04-03 at 3 13 14 AM Screen Shot 2020-04-03 at 2 52 22 AM Screen Shot 2020-04-03 at 2 48 36 AM
YordanSoares commented 4 years ago

I'm happy to read we achieve the front-end localization.

To add multilingual support to your site, you should to use a multilingual plugin like WPML. Maybe you can choose to display only english in dashboard, but I don't know how to do it yet. I tested the last pre-release I let you above, using WPML + String Translation Addon (Saudi Arabia location are translation ready now). Please see how the multilingual feature works in frontend (click to open a video screen capture):

Multilingual support for locations

ihelpco commented 4 years ago

I tried the multilingual, it is working great.

I changed my user Dashboard language to English and the state name is a dropdown menu in English, which is good. But If we can make the City field to be a dropdown, it will be English too. I hope you can make it a dropdown menu. Thanks

Screen Shot 2020-04-03 at 3 30 56 AM
YordanSoares commented 4 years ago

Hello @ihelpco,

Thanks for your feedback. I will add that issue to our list to fix it in a near future release.

I'll let open this issue to report when is done 👍

ihelpco commented 4 years ago

Hello @YordanSoares, I appreciate it. Thanks

ihelpco commented 4 years ago

Hello @YordanSoares , I guess we can make it this way:

global $places;

$places['SA'] = array( // Riyadh Region 'SA-01' => array( 'riyadh' => _x('Riyadh', 'Governorates of Saudi Arabia', 'states-cities-and-places-for-woocommerce'), ),

So, the first (riyadh) is the base name which will be read by Aramex, and the second (Riyadh) is the string that can be translated.

I am trying to get ideas from this and this. Please try it.

khalid147 commented 3 years ago

Hello @ihelpco @theprodev

If you guys are in Saudi Arabia, I would really like your help in my project.. please email me khalid.yaddee@gmail.com or contact me 0580915170