Skip to the content.

Translations

This document details how you can contribute your translations for Smart Sleep.

Structure

The strings folder contains all string values and is split into folders — one per language. These are named values-X, where X represents an ISO 639-1 language code.

For example, values-fr represents the French language. Each folder houses a strings.xml file.

How to translate

The strings.xml files house the copy displayed in Smart Sleep. They comprise an entry for each bit of text. For example:

<string name="privacy_text">Read our policy</string>

The string tags themselves must not be edited. To translate the above into French, you would use the folowing:

<string name="privacy_text">Lisez notre politique</string>

Some strings contain nested tags and/or placeholders:

<string name="to_sleep_now">If you sleep at %1$s:%2$s, you need to wake up at one of the following times:</string>

Placeholders (%s or %1$s or %2$s) tags must not be edited. To translate the above into French, you would use the folowing:

<string name="to_sleep_now">Si vous vous couchez à %1$s:%2$s, vous devez vous réveiller à l\'un des moments suivants :</string>

As such, a string of characters is translatable if preceded by > and suceeded by < or <\.

Contributing

If a directory exists for your target language, edit the strings.xml file inside. Otherwise, create a directory following the naming convention described in Structure. Inside, copy and paste strings.xml in default values folder and edit.

You are also welcome to correct existing translations. To do so, find the appropriate string tag in the localized strings.xml file and edit its content.

To submit a contribution for review, create a pull request.

Thanks for your help!

© 2024 LKONLE, and published to Google Play Store.