Hi, I’m trying to build a mobile app with multiple languages. I currently experimenting with two languages and the app texts seems to work fine and recognize my phones os language. However I would like to store the language so I could retrieve data from separate databases in different languages and even make API calls with a different language. How do I get bubble to return the language the app is currently using or the device language? I tried to use the dynamic data ‘Current language’ however this always seem to return the apps primary language, even if the app is using an other supported language.
Hey @lex_van_der_leije Current language is based on the language set for the session inside Bubble, not directly on the phone’s OS language. If you don’t explicitly set the language through workflows or user preferences, it may just stay on the app’s default. If you need the device or browser language, people usually read navigator.language using a plugin or small JS snippet and store it.
What are you using to switch languages right now workflow action or just Bubble’s automatic detection?
Hi, thank you for your help. I’m working in the native mobile builder; it standard using Bubbles automatic detection to set the apps language from one of the supported languages.
Like I said, this works for the app texts translations, but Current language always give me the applications primary language even though the application is currently using the other supported language. I would like to get the language it’s currently using. I hope this explains my problem
Some additional information: I notice a strange behavior… When I create a simple text element with the dynamic value ‘Current language’ it shows me the correct language (in this case nl_nl). However, when I try to store it to a database it stores the primary language (en_gb)