Linting

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.

Linting webapp preview

DoubleSpaces

String does not contains double space characters.

Invalid:

Foo  bar

Valid:

Foo  bar

LeadingSpaces

String does not contains leading space character.

Spacing and margin should be done with styles and not i18n content.

Invalid:

 Foo

Valid:

Foo

Three Dots Ellipsis

Three consicutive dots should be represented by an ellipsis.

Invalid:

Foo...

Valid:

Foo…

Trailing Colon

Translated string match source string trailing colon.

Invalid:

Source: Hello %{user}:
Translation: Bonjour %{user}

Valid:

Source: Hello %{user}:
Translation: Bonjour %{user}:

Trailing Ellipsis

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…

Trailing Exclamation

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!

Trailing Question Mark

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?

Trailing Spaces

String does not contains trailing space character.

Spacing and margin should be done with styles and not i18n content.

Invalid:

Foo█

Valid:

Foo

Trailing Stop

Translated string match source string trailing stop.

Invalid:

Source: Hello %{user}.
Translation: Bonjour %{user}

Valid:

Source: Hello %{user}.
Translation: Bonjour %{user}.

URL Count

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

Placeholder Count

Translated string should match source string’s number of placeholder

Invalid:

Source: Hello %{user}
Translation: Bonjour

Valid:

Source: Hello %{user}
Translation: Bonjour %{user}

Spelling

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.

Spelling webapp preview

Ready to get started?

Deploy Accent and start translating your project!