Store Locator Plugin Guide
Labels and Translation of Store Locator
Agile Store Locator provides label customization through two distinct approaches, tailored to your website's language configuration.
- Using Label (Single-Language Site): If your website is in a single language, you can conveniently modify all labels through the Labels section, as detailed in section 1 of the documentation. This is a straightforward approach and doesn't require a translation plugin.
- Using Translation (Multi-Language Site): If your website uses multiple languages, it's advisable to bypass the Labels section and instead utilize a translation plugin. With this method, you can add translations to the language files, ensuring that your labels are correctly displayed in various languages. This approach is more suitable for multilingual websites as it allows for precise language management.
1- Using Labels (Single-Language Site)
We have introduced a new Labels section in the ASL Settings, allowing you to easily update the frontend store locator labels. To change the labels, please follow the steps outlined below:
- Ensure that you are using version 4.8.29 or above of the plugin. If you are using an older version, please upgrade to the latest version first.
- Access the ASL Settings in your WordPress dashboard and navigate to the Labels section.
- Enable the Labels to switch and save the settings.
- In the Labels section, locate the specific label that you want to translate or modify. Provide the desired alternate text or label for that specific element.
Once you have changed a label for a store, it will be displayed accordingly on the frontend of your website. If you do not see the changes immediately, please remember to refresh the page cache to ensure the updated labels are applied.
In the example, we have changed the text Search Location to Find Dealers.
The front-end results of the store locator are displayed in the following format.
2- Using Translation (Multi-Language Site)
Agile Store Locator provides the option to translate the text on the map. Furthermore, this guide will show you how to manually translate the text on the Store Locator Map into other languages, please make sure the above Label is switched off if you want to change the text via translation files.
Firstly, to translate the text a user will first need to manually add the translation for each word that appears on the map.
Steps to Translate the Text
In the below guide, we will be translating the words “Search Location” on the map from English to Italian
- Install the “Loco Translate” Plugin from WordPress and activate it
- On the “Settings” tab, change the site language to the translated language. For example, English to Italian, if you need to translate the text to Italian.
- Go to the “Loco Translate” Plugin and navigate to “plugins”
- Select “Agile Store Locator” on the “Translate Plugins” page
- Choose the language file that needs to be modified (in our case: Italian)
- Manually add the translated word(s) to the language file. We have translated the “Search Location” text using google translate and added it to the language file as shown below
- Save the file and Refresh the Store Locator. The text for “Search Location” will now be translated into Italian
How to Add a New Word That is Missing From the Language File.
A user might come across a situation where the source text to be translated is missing from the language file. In this case, the user can add the source text to the template file and this will make the source text available to be translated into the language file.
For example, we will be locating the “Discounts” source text in the template file, to make it available for translation.
- Go to the “Loco Translate” plugin and select “Plugins”
- Choose “Agile Store Locator” on the “Translate Plugins” page
- Click on “Edit Template” to access the template file
- In the Template file, click on the “Sync” button, and the source text (“Discounts”) will be available in the template file, then press save
- Go to the “Loco Translate” plugin and select “Plugins”
- Choose “Agile Store Locator” on the “Translate Plugins” page and select a language page (for example English (United States))
- On the language page, press the “Sync” button and the new source text (“Discounts”) will be available for translation when it’s typed in the search bar
How to Display the Store Data in Multiple Languages
Users of Agile Store Locator can display data on their website in multiple languages for the following categories:
The data in each of these sections can be changed using the multiple language drop-down menu to change the data from one language to another (provided that there is data entered for the selected language).
For example, let's suppose a user has two sets of store data one in English and one in German, that are both entered into Agile Store Locator. Furthermore, let's say the user is displaying the English version on the store data on his/her website, and they want to change it to German. Furthermore, to do this the user can simply use the multiple Languages drop-down menu in the “Manage Stores” section to replace the English store data with the German store data (provided a CSV file was imported with German store data).
Note: The multiple language drop-down menu does NOT automatically translate the data from one language to another. Rather, it replaces the current data with another data set that is in a different language.
How to Add a New Language to the Language Drop-Down Menu?
In addition, to add a new language to the multi-language drop-down menu, please follow the below steps:
- Go to the “Settings” section on Agile Store Locator
- Under “General Settings”, scroll down to the “Site Language” options
- Enter a language you wish to enter the data in
- Click on “Save Changes”
Now the selected language will be available in the language drop-down menu.
Note: Any new entries made will automatically be saved in the same language that was selected in the drop-down menu.
For example, in the below screenshot, the entered store data will be saved in German.
How to Import/Export as a CSV file With a New Language?
Moreover, to Import a CSV file with a different language, you will simply need to create an extra column with the header “lang” and fill this column with the corresponding language code. Furthermore, leaving the "lang" parameter blank will result in the usage of the default language of the site.
How to Enforce the Store Locator to Render a Specific Language?
Lastly, to force the store locator to use or display the data in a specific section and a certain language, users can use the below shortcode to do so:
Where “fr_FR” can be replaced with any language code.
How can I change text without installing any other translation plugin?
WordPress works with WPML so the ideal and the recommended way is to change the text via any translation plugin such as Loco or WPML, you can just install it for a few minutes, make your updates to the text changes and delete that translation plugin once your changes are saved, as the job of the translation plugin is only to make changes in the language file. In case you want to avoid installing the language plugin, you have to make edits in the Store Locator Template file, here are the steps for it.
1- Goto the Plugins >Plugin File Editor, and select Agile Store Locator plugin.
2- Open up the template file that you are using, the template files are located under /public/partials/ that you can select from the right sidebar of the file selector.
3- When you open up the correct template file, search for that keyword and replace it with the new one, and save the changes.
Refresh your page to see the changes, in case your changes do not appear, check the page cache or make sure the template file backup version is not being served.