Localization in FileMaker - DB Services

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

5/12/23, 11:32 AM Localization in FileMaker | DB Services

DB Services › Blog › Localization in FileMaker

By Bryan Guevara 
Posted on  May 12th, 2023  in  Claris FileMaker, Free Downloads

Localization in FileMaker
Localization can be described as the process of adapting your application to better fit the language and
culture of the end users. Making it easier for the users to understand and use an application is integral to
an effective workplace. There are many ways of integrating localization into your application. One of the
most basic but important ways is enabling users to choose the language of the application. Let's explore
one way to achieve this in Claris FileMaker. Includes a video and sample file.

Application
To demonstrate this functionality, we'll use a small application for the data entry of products. You can
download the application from this article (located at the end of the article) and follow along.

https://dbservices.com/blog/localization-in-filemaker 1/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

As you can see, the user interface is currently in English. Let's head over to the "Setup" tab and see what
options our users have.

https://dbservices.com/blog/localization-in-filemaker 2/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

From the Setup screen, the users get access to the application's UI dictionary. From here, one can set
different keywords and specify the values in the languages supported. Usually, this setup window is
reserved for admin users or developers, as changes made here will affect the entire application. 

When a new record is created, the users can enter any value they want as the key. This value needs to be
unique, or else it will change the other value that has the same key. Then enter the values for the
different languages. The yellow dot on the left indicates that this record has not been synched into the
system yet.

Once the values have been entered, click the "Update" button, and the values will synchronize in the
system. The dot on the left will change to green to indicate that the value is ready to use.

https://dbservices.com/blog/localization-in-filemaker 3/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

Users can also change their preferred language with the dropdown on the top-right. This will
immediately change the language of all the UI features of the application.

How Does It Work? 


Let's take a look at how this works. This system has three core parts: 

A global JSON variable generated upon opening the file 


A custom function to get the labels in the correct language 
Using button bars as labels to allow us to change their values 

https://dbservices.com/blog/localization-in-filemaker 4/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

The Global Language JSON


In order to allow access to the values to all layouts, a global JSON object is generated when the file is first
opened. Here's a shorter version of the JSON generated.

"language" : "English",

"dictionary" :

"sync" :

"English" : "Sync",

"Spanish" : "Sincronizar"

},

"testText" :

"English" : "Test text",

"Spanish" : "Texto de prueba"

},

"userName" :

"English" : "Username",

"Spanish" : "Nombre de Usuario"

As you can see in the JSON, we save the language that is selected and a dictionary of the records. We can
go ahead and get the value that we need by grabbing the value of the key at the selected language. 

FileMaker has excellent support for working with JSON data, so creating this JSON object is fairly simple.
Here's the script used to generate it.

https://dbservices.com/blog/localization-in-filemaker 5/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

And here is a closer view at the Set Variable step on line 17:

JSONSetElement ( $$languageJSON ;

["dictionary." & DICTIONARY::key & "." & "English";

DICTIONARY::englishValue ; JSONString];

["dictionary." & DICTIONARY::key & "." & "Spanish";

DICTIONARY::spanishValue ; JSONString]

The Custom Function


This custom function is a way to make it more convenient for the developer to use the functionality
throughout the system. It is in charge of querying the JSON object for the value of the specified key on
the currently selected language.

https://dbservices.com/blog/localization-in-filemaker 6/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

//Name: getLanguage(key)

//Parameter: key

Let(

vLanguage = JSONGetElement($$languageJSON; "language");

vPath = "dictionary." & key & "." & vLanguage;

vValue = JSONGetElement($$languageJSON; vPath)

];

vValue

A sample call to this function would look like this:

getLanguage("nameLabel")

Button Bars as Labels


Using a button bar with a single segment as a label, we can dynamically set the displayed text. In our case,
we make a call to our custom function to get the value we want in the correct language.

https://dbservices.com/blog/localization-in-filemaker 7/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

Updating the JSON Object


There are two situations that we want to handle:

1. New values
2. Updated values
https://dbservices.com/blog/localization-in-filemaker 8/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

One simple way to handle both of these cases is to simply create the JSON Object again when new values
are added or updated. To do that, we simply attach the script that creates the JSON to the "Sync" button.

https://dbservices.com/blog/localization-in-filemaker 9/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

https://dbservices.com/blog/localization-in-filemaker 10/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

The creation of the JSON is quick enough that remaking it won't really affect the application's
performance. 

Conclusion 
Localization is very important when your application is used by people speaking different languages .
One very important aspect of localization is adding the ability for users to change the language of the
application. We demonstrated how to do this by creating a global dictionary with the labels for the
application and making a custom function to query values. We also used button bars as labels as they
support dynamic labels. 

If you would like to learn more about localization in FileMaker or explore possible ways in which
localization can make your business more effective, contact our team at DB Services and we'll gladly help
https://dbservices.com/blog/localization-in-filemaker 11/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

you find the best solution for your business.


Did you know we are an authorized reseller for Claris FileMaker Licensing?
Contact us to discuss upgrading your Claris FileMaker software.


Download the FileMaker Localization File
Please complete the form below to download your FREE FileMaker file.

First Name *

Last Name *

Company

Phone *

Email *

FileMaker Experience *

New to FileMaker Platform

Existing User of FileMaker

https://dbservices.com/blog/localization-in-filemaker 12/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

Existing Developer of FileMaker

Terms of Use *

I agree

OPT-IN: I agree that I am downloading a completely free FileMaker application file with no
strings attached. This file is unlocked, and I may use it for my business or organization as I see fit.
Because I am downloading a free file, I agree that I should receive occasional marketing. I
understand that I can OPT-OUT of these emails at anytime.

Bryan Guevara
Bryan is a methodical and detail-oriented developer with a knack for excellent customer service. He
enjoys rising to meet new challenges and is a reliable team member who brings patience and
efficiency to each project he works on.

Salesforce Financial Services Cloud Summer '23 Highlights


May 4th, 2023

https://dbservices.com/blog/localization-in-filemaker 13/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

Salesforce Nonprofit Cloud Summer '23 Highlights


May 3rd, 2023

Salesforce Summer '23 Release Highlights


April 27th, 2023

Introducing Claris FileMaker 2023


April 25th, 2023

Salesforce Nonprofit Cloud Implementation Guide


April 20th, 2023

https://dbservices.com/blog/localization-in-filemaker 14/15
5/12/23, 11:32 AM Localization in FileMaker | DB Services

Custom DynamoDB Import Wizard


April 12th, 2023

https://dbservices.com/blog/localization-in-filemaker 15/15

You might also like