Importing Strings
The fastest way to get your source strings into Stringhive is to upload the files you already have. No manual entry required.
Supported formats
| Format | Extension(s) | Notes |
|---|---|---|
| JSON | .json |
Flat or nested key-value objects |
| PHP | .php |
Laravel-style arrays returning a flat or nested array |
| YAML | .yaml, .yml |
Flat or nested mappings |
| PO / Gettext | .po |
msgid used as key, msgstr as value |
| XLIFF | .xliff, .xlf |
XLIFF 1.2 and 2.0; id attribute used as key, <target> as value |
| CSV | .csv |
First column is the key, second column is the value |
| iOS .strings | .strings |
Apple "key" = "value"; format |
| Android XML | .xml |
Android <string name="key">value</string> format |
| ZIP | .zip |
A zip containing any mix of the above formats |
Nested structures (JSON, PHP, YAML) are flattened to dot notation automatically. { "nav": { "home": "Home" } } becomes the key nav.home.
How to import
In your Hive view, click Import and select Source strings. Upload your file, choose a conflict strategy, then click Preview before committing.
The preview shows you:
- How many strings are new
- How many strings have changed (with before/after samples)
- How many strings are unchanged
Nothing is written until you click Confirm.
Conflict strategy
When a source string already exists and you're importing an updated value, you choose what happens to the existing translations:
Keep translations (default). The translations stay as-is, but they're marked as Stale so translators know the source changed. Good for minor source updates where the translation is probably still mostly right.
Clear translations. All translations for changed strings are deleted. The strings go back to Untranslated. Good when the source change was significant enough that a fresh translation makes more sense.
File naming
The filename of the uploaded file becomes the file namespace for all strings inside it. A file called auth.php creates strings in the auth.php namespace. This is preserved on export.
If you upload a .zip, the original filenames inside the zip are used.
Via the API
You can also import strings programmatically. See API: Strings for the full reference.