-
Notifications
You must be signed in to change notification settings - Fork 23
Sync Form language with UI language (if match found) #95
Comments
From @smusula on July 13, 2016 11:26 How is this expected to work? Will it possible for someone to have a url like https://enketo.ona.io/::YYGk?language=Amharic? - where Amharic is one of the languages defined in the XLSForm. |
From @MartijnR on July 13, 2016 15:10 It's not determined yet how this will work. Your suggestion is an option but it would use the official 2-character language code (IANA) instead. I think we should at least include:
|
From @smusula on July 26, 2016 9:29 Thanks for the feedback |
From @MartijnR on October 11, 2016 18:49 point 1 could be taken care of by e.g kobotoolbox@57dd427 (note this is not in master and this branch will not be merged in master) |
From @MartijnR on March 27, 2017 19:58 This issue has been reduced to only solve point 1. Though OC would need point 2 as well. Maybe as an online-only feature, or a limited set of languages that can be set in config.json since most small implementations may not need all languages. Problem is that lots of strings are added in jade/pug. |
I think this can be done.
|
…e of non-form-defined strings, OpenClinica/enketo-express-oc#95
The goal is to always sync UI and form whenever both exist |
If a form is only defined to use one language and that language/locale is not listed on the Choices or Survey sheets, will the form still be able to have a default language defined on the Settings sheet and have that be used to synchronize the form and UI text? |
No, I believe not. That would be form definition error if the default language doesn't actually exist in the form. |
So if I wanted to only offer my form in French and ensure that was used as the default language, I would only define one label column and call it "label::French (fr)" and set French (fr) as my form's default language? Is that correct? |
estimate hours |
12-16 hrs |
This is done. It was a present from me. (will be in next merge from enketo/enketo-express) |
Thanks! :) |
some details on how it works: https://docs.google.com/spreadsheets/d/1CigMLAQewcXi-OJJHi_JQQ-fJXOam99livM0oYrtbkk/edit?pli=1#gid=0 |
@MartijnR - I understand that my text columns would need to be defined like: Would I also specify the Default Language in this format: i.e., "English (en)"? |
Yes, indeed. I created an issue to make that clear on xlsform.org. Thx!
…On Mon, May 18, 2020 at 9:21 PM pbowen-oc ***@***.***> wrote:
@MartijnR <https://github.com/MartijnR> - I understand that my text
columns would need to be defined like:
label::English (en)
hint::French (fr)
Would I also specify the Default Language in this format: i.e., "English
(en)"?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEZFFSJ5GUTNU7MK5PEJWTRSH3MTANCNFSM4FUINGBQ>
.
--
*Pushing data since 2012.*
Enketo <https://enketo.org> | LinkedIn
<http://www.linkedin.com/company/enketo-llc> | GitHub
<https://github.com/enketo> | Twitter <https://twitter.com/enketo>
| Blog <http://blog.enketo.org>
--
--
*Revolutionizing data collection since 2012.*
Enketo
<https://enketo.org/> | LinkedIn
<http://www.linkedin.com/company/enketo-llc> | GitHub
<https://github.com/enketo> | Twitter <https://twitter.com/enketo>
| Blog <http://blog.enketo.org/>
|
@MartijnR - Do we need to do anything to enable language syncing based on browser language settings? I created a form with "French (fr)", "English (en)", and "German (de)" defined in that order for all content columns. Default language is defined in the form as "German (de)". When I open the form, the following language list is visible in the network calls: Since my Windows browsers (tested in Chrome, Edge, Firefox) are set to English (United States), I expected that opening the form would default the language selector to English. However, in most cases, I'm getting German. I'm getting the same results with my iPhone/iPad as well. v2.5.6.oc-11 current master: Other modes tested: /view/fs/i/, /single/fs/c/i/, /edit/fs/c/i/ Any idea what I am doing wrong or what we need to change? |
I believe not defining a default language would make it do what you want. The feature has evolved a bit lately. See this sheet: https://docs.google.com/spreadsheets/d/1CigMLAQewcXi-OJJHi_JQQ-fJXOam99livM0oYrtbkk/edit#gid=1504432290 |
@MartijnR - I am still seeing an issue with this on the latest master branch after removing the Default Language configuration. On our Preview server, it seems to be working as exactly as expected based on our discussion. French is the first language in my form, but it loads for me in English and the form language and UI language are both English and change together if I select French or German. On our primary editing server, it loads with French selected. Additionally, while the language selector controls the form language as expected, it has no effect on the UI language. So, the form loads with my French text but English buttons. Test Form: Preview mode working as expected (after selecting French manually): Edit mode not synced and not loading in bowser language (with French incorrectly selected upon load or if I later manually select French): Edit: |
|
Possibly related to this https://github.com/OpenClinica/enketo-express-oc/blob/master/public/js/src/enketo-webform-fieldsubmission.js#L163 (happened to notice when working on other issue) If so, it might get fixed by OpenClinica/enketo-oc#156 |
EE-OC: http://localhost:8005/single/fs/i/B2QloRRY?ecid=1 - UI lang is correct, form language is incorrect first language (french) |
@MartijnR - I have a question and an issue to report. I am using version 2.8.0.oc-9.
I had expected to get English since it is my #2 browser language and it is a language used in the form. However, I am getting the form in the first language as defined in the XForm. Is Enketo expected to only utilize the default language set in the browser and if that is not in the form it would just fall back to the first XForm language?
Form first opened (languages synced): Language changed (UI has not changed): Language changed (UI has changed, but to the previous selection): |
|
This is working as expected and simply needs to be documented on our end. The form will only have knowledge of the primary language in the browser and not and other preferred languages in the browser settings. |
From @MartijnR on June 23, 2016 22:13
Will require recommended language name with iso code such as
English (en)
,Arabic (ar)
as agreed in ODK Dev forum: https://groups.google.com/forum/#!searchin/opendatakit-developers/language$20names$20proposal%7Csort:relevance/opendatakit-developers/ZLDJanOCudE/T7yTrDMYVAsJSee "Tip: Prepare for the Future" in this post: http://blog.enketo.org/advanced-language/
Algorithm:
Copied from original issue: kobotoolbox#526
The text was updated successfully, but these errors were encountered: