Language Alignment to be in Right (Arabic Language)

I am using the web

Design-hint: You need to set also all used messages to the ::language (code) format, e.g. constraint_message (if not system default). hint, guidance_hint, required_message (if not system default).

And you should add default_language in the form settings sheet. See Form Language - ODK Docs. Additionally, you may need to set your language to Arabic (ar) in your account (Enketo/ODK) account, and perhaps in your browser.

$-references must be written as {VariableName}$ in Arabic text elements, e.g. label or _message. But in normal English format in formulas, e.g. calculation or constraint.

If the first question, hint, or note is written in a left-to-right script the form will automatically format the rest of the translation to a left-to-right format. (You may avoid this by adding an right-to-left Arabic label to the first visible item.)

Further hints and examples can be found with the search function of this forum, in the Help Center article and in the ODK documentation:

Other hints:
- Use own readable naming for variables and choices (instead of the cryptic generated names from the Formbuilder).
- Avoid spaces (and special characters) in file names, please, e.g. for your logo.
- You don’t need to write false for required, this is the system default.

1 Like

@wroos, :clap: :heart: :partying_face:

I already set the default language Arabic. I do not need the English language or any other language. Just the survey has to be in Arabic
How can I add an right-to-left Arabic label to the first visible item?

I do not need the English language or any other language.
Yes, this was understood, but the links also explain general issues.

Could you share an extract of your XLSForm here, please, some first lines, incl. the column headers and the settings sheet? If needed, you can download it (as XLS) from the project menu.

label means the question text.

1 Like

- Would you mind to share this part of your form as XLSForm?
- Can you also provide a screenshot of the alignment problem, please?
- Are you using Collect or Enketo (Webform)?

How is the language configuration environment:

  • Phone / app?
  • Browser / Kobo project account?

Do you want to enter text and numbers in AR? (Right to left aligned)

1 Like

I was trying to upload the all XLSForm but I got a message that : the new user are not allowed to upload such documents. so how can I share with you my XLSForm?
Second I will provide a screenshoot that shows how the arabic alignment is from left to right , instead of showing from right to left.
Third, I am using the browser Kobo project account

@Kal_Lam can provide upload rights, please.

Did you change the KoboToolbox language to AR, in the account menu, please? You may need to change the Browser language to AR too.

Do you use Enketo (Webform) or Collect for the data collection?

1 Like

I changed the Kobotoolbox language to AR and also I changed the browser language to AR and I am still having an alignment from left to right.
I am using Enketo webform

You may try the following, please:

  • Make sure that the ::language column title is written with the code, i.e. ::Arabic (ar)
  • Add an AR (only) label and/or hint to the first visible item (note)…
1 Like

@sabinenassimmeal, you should now be able to upload XLSForm to the community forum. Refresh your browser if it’s still not allowing.

aHRv2WxKJc9QexJnmWTQMb (1).xlsx (9.4 KB)

thank you so much , I uploaded it

I uploaded my XLS , may you check it please!

The problem seems an automatic language detection by Kobo (and ODK?) based on the first label/hint for the first visible item, i.e. in your case the . (dot) in the first note.

So, you need to add a dummy note at the first place and make it invisible by setting relevant to false. See example ar01.xlsx (11.0 KB). Image was not yet uploaded here.


(Same appearance in Online validator preview.)

Another option would be to give your original first note an AR (textual) label, not only a . (dot).

In Enketo, you should also set an AR required_message ( e.g. هذه الخانة مطلوبه ) for “This field is required”. Otherwise you will get the EN default/system message. (AR translation seems missing here in Enketo.)

This required_message setting is not necessary in Collect. But in Collect you need to set the project/app language to AR. Otherwise you will get mixed alignment, e.g. selects on the left.

Maybe, some AR or other RightToLeft language experts from the community have further solutions and hints, please.

As far, as I tested, the following would not solve the alignment issue for Enketo (and the EN requirement message):
- Change the KoboToolbox language to AR, in the account menu
- Change the Browser language to AR too.
- Add an AR label or/and hint to the start metadata. (first meta item, invisible)
- Add a calculate with an AR label or/and hint.
- Try to reformat the . dot in Excel (type Arabic, right to left cell alignment).

Thank you so much, the problem is solved, after adding the dummy note with relevant false.
Thank you so so much for your support.