Accent offers a way to validate certain checks for strings and translations.
For now it only checks a string when there is an input in the UI.
String does not contains double space characters.
Invalid:
Foo bar
Valid:
Foo bar
String does not contains leading space character.
Spacing and margin should be done with styles and not i18n content.
Invalid:
Foo
Valid:
Foo
Three consicutive dots should be represented by an ellipsis.
Invalid:
Foo...
Valid:
Foo…
Translated string match source string trailing colon.
Invalid:
Source: Hello %{user}:
Translation: Bonjour %{user}
Valid:
Source: Hello %{user}:
Translation: Bonjour %{user}:
Translated string match source string trailing ellipsis.
Both string should end with an ellipsis as it conveys meaning to a sentence.
Invalid:
Source: To be continued…
Translation: À suivre
Valid:
Source: To be continued…
Translation: À suivre…
Translated string match source string trailing exclamation.
Both string should end with an exclamation as it conveys meaning to a sentence.
Invalid:
Source: This is awesome!
Translation: C’est super
Valid:
Source: This is awesome!
Translation: C’est super!
Translated string match source string trailing question mark.
Both string should end with a question mark as it conveys meaning to a sentence.
Invalid:
Source: How are you?
Translation: Comment vas-tu
Valid:
Source: How are you?
Translation: Comment vas-tu?
String does not contains trailing space character.
Spacing and margin should be done with styles and not i18n content.
Invalid:
Foo█
Valid:
Foo
Translated string match source string trailing stop.
Invalid:
Source: Hello %{user}.
Translation: Bonjour %{user}
Valid:
Source: Hello %{user}.
Translation: Bonjour %{user}.
Translated string should match source string’s number of URL
Invalid:
Source: This is a link: https://google.com
Translation: Voici un lien
Valid:
Source: This is a link: https://google.com
Translation: Voici un lien: https://google.ca
Translated string should match source string’s number of placeholder
Invalid:
Source: Hello %{user}
Translation: Bonjour
Valid:
Source: Hello %{user}
Translation: Bonjour %{user}
The spelling rule is a bit more complicated than the other rules. It’s an integration with the open-source grammar, style and spell checker Language Tool.
If the instance of Accent is started with the SPELLING_GATEWAY_API_URL
env var pointing to a public Language Tool instance, you will see spell checking in the UI.
Deploy Accent and start translating your project!