How To Use The SQL Generator
The SQL Generator is a tool inside the Translations Editor. It takes the translation file from an app and makes the Translations Editor match it.
Use it when the text in an app has changed and the Translations Editor is now out of date, for example when:
- New text has been added to the app and it is not in the editor yet.
- Text has been removed from the app but is still sitting in the editor.
- The English wording was changed and the Irish needs to be redone.
- A brand new project is being added to the editor for the first time.
Nothing is changed until you press the final green button. You can safely press Analyze as many times as you like just to see what would happen.
What You Need
- A login for translations.abair.ie.
- The translation file from the app, in JSON format (see What the file should look like below).
- The name of the project you are updating.
Method
Open the Tool
- Go to translations.abair.ie and sign in.
- In the menu on the left, under Tools, click SQL Generator.
Choose the Project
- Click the Project Name box at the top left.
- A list of the projects already in the editor drops down. Start typing to narrow the list, then click the one you want (or use the arrow keys and press
Enter).
If the project is brand new, just type the new name in yourself. Everything in your file will then be treated as new.
Choose a Sync Mode
This is the most important choice on the page, because it decides what happens to the Irish translations that are already saved.
| Mode | What it does | When to use it |
|---|---|---|
| Add New & Remove Unused | Adds anything in the file that is missing from the editor, and deletes anything in the editor that is no longer in the file. Text that already exists is left completely alone. New entries come in with the Irish left blank. | The safest option. Use it when text has simply been added or removed in the app, and you do not want to disturb any translation work already done. |
| Sync English (Reset Irish) | Does the same adding and deleting as above, and on top of that: if the English wording has changed, the new English is saved and the Irish is emptied so it can be translated again. Irish is never touched for anything else. | Use when someone has reworded the English in the app. This is the option selected by default. |
| Full Sync (Overwrite) | Makes the editor an exact copy of your file — English and Irish. Anything not in the file is deleted. | Use when the file is the correct, final version, such as the very first import of a project. |
Full Sync (Overwrite) will replace Irish translations in the editor with whatever is in your file. If the file has blank or old Irish, that translation work is lost. If in doubt, pick one of the first two options.
Paste the File
- Copy the whole contents of the translation file.
- Paste it into the big JSON Input box.
Press "Analyze & Generate SQL"
- Click the blue Analyze & Generate SQL button.
The tool compares your file against what is currently saved and shows you the result. Nothing has been changed yet.
Check the Changes
Three coloured boxes appear on the right:
-
New (green) — entries that will be added.
-
Updated (yellow) — entries that will be changed.
-
Deleted (red) — entries that will be removed.
-
Click View Change Details to see exactly which entries are in each group.
A window opens with three tabs — New Entries, Updated Entries and Deleted Entries. The Updated tab shows the old wording crossed out in red beside the new wording in green, so you can see exactly what is changing.
Always read the Deleted tab before going any further. Deleting cannot be undone. If the number looks far too high, it usually means the wrong project name was chosen, or only part of the file was pasted in.
The Generated SQL box underneath is just a written record of the same changes. You do not need to do anything with it, but you can copy it if you want a note of what was done.
Press "Execute on Supabase"
When you are happy with the changes:
- Click the green Execute on Supabase button (it is on the main page, and also at the bottom of the details window).
A green box confirms what was done, for example "12 entries inserted, 3 entries updated, 1 entry deleted".
That's it — the changes are live. You can now go to the project's page in the editor and start translating anything that came in blank.
What the File Should Look Like
The tool expects the file to be laid out like this, with an en section and a ga-IE section:
{
"en": {
"translation": {
"common": {
"hello": "Hello",
"goodbye": "Goodbye"
}
}
},
"ga-IE": {
"translation": {
"common": {
"hello": "Dia dhuit",
"goodbye": "Slán"
}
}
}
}
common here is a group name, and hello and goodbye are the labels the app uses to find each piece of text. You do not need to change any of this — just copy the file across as it is.
If Something Goes Wrong
| Message | What it means |
|---|---|
| Please enter JSON data | The big text box is empty. |
| Please enter a project name | No project has been chosen or typed in. |
| Invalid JSON format | Something is wrong with the text you pasted — usually a missing bracket or comma, or only part of the file was copied. Copy the whole file again. |
| No translation data found in the provided JSON | The file was read fine, but it is not laid out the way the tool expects. Compare it with the example above. |
| Execution Failed | Something went wrong while saving. Press Analyze & Generate SQL again to see what is left to do, and try again. |
If you change the project name, the sync mode, or the pasted text, the results disappear and you need to press Analyze & Generate SQL again. This is on purpose, so you never run changes that were worked out from different settings.