Database Localization
Localize the text and images in your database tables: choose how to store the languages, select the fields to translate, translate them in Soluling, and let Soluling write the translations to the database.
Product names, descriptions, and other data that the user sees need translating just like the user interface. Soluling connects to the database itself, so you don't export and import anything. The guide follows the Sport sample, a small table of team sports, and takes it from English to Finnish, German, and Japanese.
- Input
- A database file, such as
.accdbor.db, or a connection to a database server - Output
- Localized database files, or translations written to rows, fields, or tables
- Databases
- Access, SQL Server, SQL Server Compact, MySQL, PostgreSQL, SQLite, Firebird, and InterBase
- Cloud
- Create the project in Soluling Desktop, and let translators work in a browser
On this page
- Tutorial: localize a database step by step
- Context: how rows are identified
- Untranslated values
- Unicode data
- Images and other data types
- Translate in Soluling Cloud
- Do and don't
- Troubleshooting
- Samples
- FAQ
Localize a database, step by step
Six steps take the Sport table from English only to a localized database.
Prepare: choose how to store the languages
A database has no resources, so the translations go into its normal structure. There are four ways to do this, and each one stores the same translations differently:
| Method | Choose it when | The catch | SELECT for German |
|---|---|---|---|
| File | You use Access, SQLite, or SQL Server Compact, and want no changes to the tables | Works only with databases stored in one file; every language is a full copy | The same SQL, on de\Sport.db |
| Row | You only read the table, and want to add languages without changing the structure | The table grows with each language, and an edit must reach every language's row | SELECT Name FROM Sport WHERE Language = 'de' |
| Field | You want one row for each item, and have few languages | A new language means new fields | SELECT Name_de FROM Sport |
| Table | You want to keep the original table as it is | A new language means a new table, and reading needs a join | SELECT Sport_de.Name FROM Sport INNER JOIN Sport_de ON Sport.Id = Sport_de.Id |
Soluling doesn't change the structure, so make these changes yourself before you create the project. This is the row method, with the language in the primary key:
CREATE TABLE Sport
(
Id INTEGER NOT NULL,
Language VARCHAR(10) NOT NULL,
Name VARCHAR(50) NOT NULL,
FieldPlayers INTEGER NOT NULL,
PRIMARY KEY(Id, Language)
);
Then change your code to read the active language, by choosing the database file or by changing the SELECT as shown in the table. Use Unicode text fields; see Unicode data.
Add: select the fields to translate
Create a project and select the database: the file, or the connection details of a database server. Project Wizard shows the Properties sheet with the tables and fields.
-
Soluling tries to detect the method and selects the fields for you. It recognizes a language field, and language fields such as
Name_deorNameDe. - Double-click a field to select or clear it. In the Sport sample, these are
Name,Origin, andDescription. - If Soluling doesn't detect a language field or table, drag it under the original field or table.
- On the Select Languages page, add the target languages, and click Finish.
Translate: by fields, rows, or groups
Each value is a row in the grid. By default, the project tree groups the values by fields, so selecting Name shows every name. You can change this to by rows, flat, or by groups in the source options at any time without losing translations. To show translators a comment for each value, use a comment field; see the Comment sample.
- Machine translation and translation memory. Click Use Machine Translation to translate with Amazon, Claude, DeepL, Google, Microsoft, ModernMT, or MyMemory, and reuse earlier translations from translation memory and terminology.
- External translators. Send a translation package, an Excel file, or XLIFF to a translator, and import the results back. See teamwork.
- Translators in a browser. Upload the project to Soluling Cloud and let translators work in Translate.
Check: find problems before release
- Pseudo translation. Click Translate | Pseudo Translations | Fill, build, and run the application. Pseudo translations are longer and use accented characters, so texts that don't fit and strings still in the code (shown in plain English) stand out. See pseudo translation.
- Validation. Soluling validates translations while you type and in batch (Validation | Validate Translations): missing translations, inconsistent placeholders and patterns, duplicate hotkeys, and more. See validation.
Translations are often longer than the original, and a field has a fixed size. The Maximum characters validation finds translations longer than the length you specify. See validation.
Build: write the translations to the database
Choose Home | Build All. With file localization, Soluling creates a copy of the database for each language. With the other methods, it writes the translations to the database that you selected, so a production database changes right away. Build against a development or staging database, and deploy from there.
Update: translate only what changed
When the data changes, click Home | Scan. Soluling matches the values by their key, keeps the existing translations, and adds what is new. Translate the new and changed values, and build again. You can automate the scan and build steps in your build pipeline with the SoluMake command-line tool.
Context: how rows are identified
Soluling identifies each value by its table, field, and the primary key of its row, such as Sport.Name.0. A number doesn't tell a translator much. If another table has a name for the key, use it instead: on the Items sheet of the source, right-click the table and choose Add ID name lookup. After a scan, the context reads Sport.Name.Soccer. See ID name lookup.
Untranslated values
Decide what your application shows when a value has no translation yet, because the multilingual options of the source control what Soluling writes:
| Method | Options | Default |
|---|---|---|
| Field and table | Use the original value, an empty value, or a null value, or don't write the item | Don't write the item |
| Row | Add the localized row always, if it has at least one translation, or only if all its translations are complete | If it has at least one translation |
With the row method, a row may not exist yet for a language, so a query with WHERE Language = 'de' doesn't return it. If you need the original value then, read it in your code or choose Always.
Unicode data
One Ansi code page can't hold every language, so use Unicode when you create tables that are localized.
| Database | To store Unicode |
|---|---|
| Access, SQLite, SQL Server Compact | All text is Unicode. |
| SQL Server | Use nchar and nvarchar. From SQL Server 2019, char and varchar can use a UTF-8 collation. |
| MySQL | Use utf8mb4. MySQL's utf8 can't store all Unicode characters. |
| PostgreSQL | Use a database with UTF8 encoding, the default in most installations. |
| Firebird, InterBase | Use the utf8 character set for the database or the field. |
Images and other data types
Besides plain strings, Soluling can localize text fields that hold XML, JSON, or HTML; binary fields that hold images, audio, video, documents, or Zip files; and integer, floating-point, and boolean fields. It detects most formats. If it doesn't, right-click the field in the database tree and choose the format. To see more field types in the tree, check them under Visible field types on the Properties sheet. See data types.
Translate in Soluling Cloud
With Soluling Cloud, translators use Translate in a browser. How you start depends on what you localize:
- Databases. Soluling Cloud can't read a database itself. Create the project in Soluling Desktop, and choose Translate | Configure Cloud to upload it. Use Import from Cloud to get the translations back and build the localized files locally. Your application files never leave your machine.
To run the scan, upload, import, and build steps in your build pipeline, use SoluMake. See the Cloud tutorial and workflows.
Do and don't
Do
- Use Unicode text fields.
- Make text fields long enough for longer translations.
- Keep the primary key values stable, because they identify the translations.
- Give translators a meaningful context with an ID name lookup.
- Build against a development or staging database.
- Apply your edits to every language's row, field, or table.
Don't
- Select fields that aren't text for the user, such as IDs and codes.
- Expect Soluling to change your tables; add the language fields, rows, or tables yourself.
- Use file localization with a server database; it needs a database stored in one file.
- Use MySQL's
utf8; useutf8mb4. - Build against a production database without a backup.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The application shows the original language | The code still reads the original file, field, or table | Change the connection string or the SELECT to use the active language. |
| Characters are replaced by question marks | The field or the database isn't Unicode | Use a Unicode data type; see Unicode data. |
| A language field isn't detected | Its name doesn't end with the language code | Drag it under the original field, or rename it, such as Name_de. |
| Localized rows are missing | The row has no translations, and the default option adds only rows with a translation | Translate the row, or change the option in the multilingual options. |
| A field isn't in the list | Its type isn't visible | Check the type under Visible field types. |
| File localization isn't available | The database is on a server | Use the row, field, or table method. |
Samples
Each database has its samples in Samples of the Soluling installation and on GitHub, such as Samples\SQLite and Samples\SQLServer. Use the .sql files to create the tables on a database server.
- Sport: the table of this guide, with a folder for each method:
Copy,Row,RowId,Field, andTable. Some databases have only some of them. Study this first. - Simple: a simple sample for Firebird, InterBase, and SQLite.
- Comment: comment fields for translators (SQLite).
- Composite: a composite primary key and the by groups structure (Access and SQLite).
- Image, Data, and Types: images, binary data, and other data types.
- Encoding: Ansi and Unicode fields (SQL Server).
See database localization in the Desktop documentation for all the details.
FAQ
Image sample.Related
- Database localization - the full Desktop documentation
- SQL Server, MySQL, PostgreSQL, SQLite, and Access - notes for each database
- Supported formats - everything else Soluling localizes