-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for detecting multipart strings
- Loading branch information
1 parent
6b0f0ca
commit dc442ac
Showing
18 changed files
with
308 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
```{r} | ||
#| include: false | ||
#| eval: true | ||
source('../R/appdown.r') | ||
``` | ||
|
||
# Internationalization Issues | ||
|
||
Internationalization (i18n) occurs during the development stage of software, which includes (but not limited to) the following areas: | ||
|
||
- Preparing the program to display numbers and dates using the client's regional settings. | ||
- Exposing strings for translation. | ||
- Ensuring that strings not meant for translation are not exposed to translators. | ||
|
||
I18N issues include any problems during this stage which will later affect either translation efforts or regional display issues for clients. | ||
This chapter will discuss these various issues and provide recommendations for how to detect and correct them using *Quneiform*. | ||
|
||
## Multipart Strings {#sec-multipart-strings} | ||
|
||
Multipart strings (or "mega strings") are single string resources that are split at runtime into smaller strings [@madden:2019]. | ||
|
||
For example, consider a resource string such as: | ||
|
||
`"Name Password Domain "` | ||
|
||
While this is one string, it contains suspicious looking blocks of spaces in between each word. | ||
As it turns out, an application may be splitting this string into 10-character sections at runtime: | ||
|
||
```{r} | ||
#| echo: false | ||
#| out-width: 100% | ||
#| fig-format: png | ||
#| fig-align: center | ||
library(DiagrammeR) | ||
DiagrammeR(' | ||
graph TB | ||
A["“Name Password Domain ”"]-->B["“Name ”"] | ||
A["“Name Password Domain ”"]-->C["“Password ”"] | ||
A["“Name Password Domain ”"]-->D["“Domain ”"] | ||
') | ||
``` | ||
|
||
Then, it will use each of these sections as a separate resource. | ||
This is a bad practice found in legacy software, and can be thought of as the opposite of concatenating strings (another bad i18n practice). | ||
|
||
The issue with this practice is that it forces translations to a constrained length (10-characters for each word in this example). | ||
Next, it is difficult to translate, as the translator must count the characters and spaces for each word segment, not just the entire string. | ||
(And this is assuming that the behavior of this string was even communicated to the translators.) | ||
Finally, l10n quality assurance tools are not designed to check unusual strings like this. | ||
Validating translations for these resources requires custom tools, which creates unnecessary technical debt. | ||
|
||
If a translator doesn't format each segment of this string perfectly, then at best the translations will overlap or be clipped at runtime. | ||
At worst, the program will crash in situations where the full string is less than 30 characters. | ||
|
||
It is preferred to use separate resources for each string. | ||
This ensures that the translations aren't constrained to arbitrary lengths and QA tools will be able to review the resources with ease. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.