String ordering refers to the sequence in which strings are displayed in Smartling. You’ll find strings in two main areas of the platform: the Strings View and the CAT Tool. Depending on how your source file was ingested into Smartling, these areas may display the same content in different sequences.
As a quick reference, here’s what determines the default order in each area:
- Strings View: Source file order (the order strings appear in the file that was uploaded)
- CAT Tool: Source file order, unless Visual Context is available, in which case Visual Context order takes precedence
- Strings View CSV Export: String hashcode order
- CAT Tool QA Export: The order in which strings were ingested into Smartling, which may be different from the default order displayed in the CAT Tool
Read on for more detail on each of these.
Default string order
When a file is uploaded into Smartling (ingested), the default string order in the Strings View and in the CAT Tool is the same order as in the source file.
An exception to this rule is in PowerPoint files, where the default string order is the order of the text boxes containing the strings, which may not be the same sequence as how they are displayed in the file.
Let's explore the factors of string ordering with the example file below.
Example source file
Strings View
The Strings View displays strings in the order of strings in the source file.
Strings View CSV export
The export of the Strings View is ordered by string hashcodes.
CAT Tool
The CAT Tool displays and numbers strings in the same order as strings in the source file. However, in the CAT Tool, Visual Context takes precedence over the source file order as this is what linguists need to work with to visualize their translations. Therefore, when Visual Context is included in the job, the matched strings display in the same sequence as seen in the context panel. This results in the string numbering being "out of order" as well.
If you need strings to display in source file order regardless of Visual Context, sort the CAT Tool by String Number instead (see below).
In addition, when a job includes strings bound to more than one context (for example, separate context images per page or frame), strings within a single context are ordered correctly. However, there's currently no predictable order for which context comes first, second, and so on. As a result, strings from different contexts may not be displayed in a consistent overall sequence.
The string order in the CAT Tool can always be adjusted to that of the String Number, which is the order of strings in the source file.
String numbers are only visible in jobs with fewer than 2,000 strings, and don't display on locked strings. For more detail, see String Numbering in the CAT Tool.
CAT Tool QA export
The order of the strings in the QA Export is determined by the order they were ingested into Smartling, which is different from the order shown in the CAT Tool.
If you need to view strings in the same order you see in the CAT Tool (sorted by String Number), export the strings from the Strings View instead. This export can be sorted by String Number and File/URL in a program like Excel or Numbers to match the CAT Tool's order. For more information, see Export Strings to CSV.
Order across multiple files
The information above describes string order within a single file. When a Strings View or CAT Tool session includes strings from more than one file, for example a job containing multiple files, the files themselves are ordered alphabetically by file name in both areas. Within each file, the strings still follow the source file order described above.
If your content spans multiple files and you need strings to display in a specific sequence, name your files so that alphabetical order matches your intended order. For example, naming your files Batch A.json and Batch B.json will display Batch A.json first.
Be careful with descriptive names that don't happen to follow alphabetical order. For example, first batch.json and batch 2.json would display in the reverse of the intended order.
String numbers across multiple files
In the CAT Tool, string numbers reflect the order strings entered the job, not the order strings appear in the list. Since strings are grouped and displayed alphabetically by file name, you may see number sequences that aren't consecutive. For example, you might see strings numbered 4, 5, 6, followed by strings numbered 1, 2, 3, rather than numbers increasing consecutively down the list. If you want to view strings in number order, sort the CAT Tool by String Number instead.
Note that string numbers only display in jobs with fewer than 2,000 strings total. For more detail, see String Numbering in the CAT Tool.
Out of order
In addition to Visual Context, other causes of discrepancies in ordering includes when the content is modified or added to the source file.
For example, uploading a resource file that has no key nesting, will result in the strings being displayed in Smartling in the same sequence as the file, as expected. However, if that file is modified by adding strings to the beginning or middle of the file (not just the end), the string order in Smartling will not mirror the new order of the source file; the string that is added to the file last will be the last string to be displayed in Smartling, regardless of where is it positioned in the source file.
Conclusion
The order of the strings depends on many technical variables including parsing, context, updates to source content etc. Smartling cannot guarantee the order of the strings will always match that of the content within the file.
FAQ
Why do strings appear in a different order in the Strings View, CAT Tool, and exports?
Each area follows its own default rule. The Strings View and CAT Tool both follow source file order, unless Visual Context is present in the CAT Tool, in which case context order takes precedence. The Strings View CSV Export follows string hashcode order, and the CAT Tool's QA Export follows ingestion order. See the summary above for details on each.
Why does the CAT Tool show strings out of order compared to the source file?
This is usually caused by Visual Context. When a job includes Visual Context, strings display in the same sequence as the context panel rather than the source file. Sort the CAT Tool by String Number to view strings in source file order instead.
Why don't I see string numbers in the CAT Tool?
String numbers are only visible in jobs with fewer than 2,000 strings, and don't display on locked strings. See String Numbering in the CAT Tool for more detail.
How do I control the order of strings across multiple files?
Files are ordered alphabetically by file name in both the Strings View and the CAT Tool. Name your files so that alphabetical order matches your intended sequence, for example Batch A.json and Batch B.json. Note that string numbers in the CAT Tool follow a different rule, based on when strings entered the job, so numbers may not run sequentially with the display order.
Why doesn't the CAT Tool's QA Export match the order I see in the CAT Tool?
The QA Export is ordered by the sequence in which strings were ingested into Smartling, not the order they are displayed in the CAT Tool. If you need an export that matches the CAT Tool's order, export from the Strings View instead, then sort by String Number and File/URL in a program like Excel or Numbers. See Export Strings to CSV for steps.