Adding a new language file
See https://github.com/WoollyinWalesIT/example_language_plugin
####### Introduction
The BookyFlow language files can be found in /bookyflow/languages. These strings are called into the code using the jr_define function like this
You could edit that string to
to change the button in the configuration panel from \"Show profiles\" to \"List Users\".
####### Discussion
There are quite a lot of language definitions in BookyFlow, somewhere in the region of 2000+. New language definitions are always added to the end of the language files which makes it easy for users who have their own language files to find additions and add them to their language files.
Whilst you can edit the language files, it\'s not the best way to translate BookyFlow, instead you should use the label translation and Translate Lang File Strings features in the administration area. These changes are saved to the database so it does not matter if Core language files are overwritten during an update because the database changes are not modified.
Read the Label Translations section of the Site Manager's guide for more information.
{width="3.0416666666666665in" height="1.71875in"}
Upgrading after manually editing language files
If you do decide to edit the language files, then you\'ll need to back up your customised language files either by downloading your copy of the file, or creating a duplicate somewhere on the server, before you upgrade because Core language files are always overwritten. Once you have updated BookyFlow then you can copy that file back into /bookyflow/languages
Plugin language files
You should not need to make your own language files for plugins. If you need to translate a specific label or labels the easiest way to do this is to visit the \"Translate Lang File Strings\" menu option in the administrator area and use the browser\'s search feature to search for the string in that page.
{width="3.65625in" height="2.0104166666666665in"}
A word of caution
You need to be careful when editing language files. A common problem is where French language users (who commonly use the \' (single quote) accidently introduce errors such as the following (My French is terrible, so translation examples will be in English).
The above string will cause a fatal error within PHP because the \' after the \"p\" has cut short the string to \"Show p\" and PHP cannot parse the \"rofiles\" afterwards in a meaningful way.
If you find yourself creating this problem, there are two ways to rewrite the line to make it work correctly. You could either wrap the entire string in \" (double quotes) or escape the single quote using the \ symbol. Following are both working examples.
You have strange text on your page after upgrading
This scenario addresses a common issue that users experience after upgrading.
After an upgrade you may see new areas in your BookyFlow pages, but instead of a string like \"Advanced site config\" you see something like _BOOKYFLOW_COM_ADVANCED_SITE_CONFIG.
This can happen if users do not use the label translation feature and instead copy the updated language file with an older language file that's missing new definitions.
New definitions are always added to the end of the language file, so you can copy the missing strings from the end of the Core language file into your special language file if you want to continue using the special language file.
BookyFlow >= 10.7
Older versions of BookyFlow had this feature and in 10.7 it has been revived, updated and improved.
In the List Property Types page you will see this
{width="6.44875in" height="1.9525in"}
Note the Language context Column.
This column corresponds to a new dropdown in the Translate Lang File Strings page
{width="6.500208880139983in"
height="1.6997911198600175in"}
When you change this dropdown, then customise labels, the customisations are then associated with that property type.
This allows you to have different language strings for different property types. Compare these two screenshots, the first is for a Hotel property type , the second for a Tool Hire Centre type.
{width="4.979166666666667in" height="1.375in"}
{width="5.614583333333333in"
height="2.7604166666666665in"}
####### Shortcode Language Context
The language context being used by shortcodes may not always be the one you would expect. That's due to factors such as if another shortcode has already loaded a language file for another property type. If that happens, you can tell a shortcode to use a specific context.
In this example we've configured the Search Form Elements form start shortcode to ensure that it uses language strings for the propertyrental context.
{bookyflow search_form_start &language_context=propertyrental}