DrupalGap icon indicating copy to clipboard operation
DrupalGap copied to clipboard

Changing the language of the UI without changing the language in forms, e.g.

Open luxio opened this issue 8 years ago • 3 comments

Is it possible to change the default language in DG but leaving the field values in forms to und.

luxio avatar Mar 09 '17 21:03 luxio

In my case I was able to solve this by preproccesing the service call and copying the language specific field to und field. See https://www.drupal.org/node/2845167, hope it helps!

majuril avatar Mar 14 '17 08:03 majuril

@majuril Thank you. That would work. Using this approach, I would have to preprocess a couple of service calls (nodes, webforms, files, e.g.).

I have solved this by setting Drupal.settings.language_default to und and rewriting the t() function using the language set on the phone only for the UI.

Are you using the cordova-plugin-globalization to set the language?

luxio avatar Mar 14 '17 08:03 luxio

I'm not using cordova-plugin-globalization. My app defaults to en-language and I have created a custom page/form where users can define their Drupal.settings.language_default. Based on that selection DG uses different locale files in my app.

majuril avatar Mar 14 '17 08:03 majuril