# Adding language selection to my app

**URL:** <https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219>\
**Category:** Questions about Thunkable X\
**Tags:** design, beginner\
**Created:** [November 15, 2021, 10:49am UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219 "2021-11-15T10:49:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![denemeyanilma892420](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@denemeyanilma892420](https://community.thunkable.com/u/denemeyanilma892420)\
**Post date:** [November 15, 2021, 10:49am UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/1 "2021-11-15T10:49:41Z")

</div>

Lets say we have 2 screens , and by pressing english i want to change my labels and buttons to english,  
is it possible to do it ? Any design ideas ? Thanks

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 15, 2021, 10:57am UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/2 "2021-11-15T10:57:03Z")

</div>

Check this app

[https://x.thunkable.com/projectPage/60a013d7aed6ad0012a487bf](https://x.thunkable.com/projectPage/60a013d7aed6ad0012a487bf)

---

<div class="post-metadata">

**Author:** ![denemeyanilma892420](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@denemeyanilma892420](https://community.thunkable.com/u/denemeyanilma892420)\
**Post date:** [November 15, 2021, 10:59am UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/3 "2021-11-15T10:59:35Z")

</div>

thanks a lot this will help me a lot

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [November 15, 2021, 2:42pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/4 "2021-11-15T14:42:17Z")

</div>

@denemeyanilma892420  
My method is:  
Create a page, you can choose the language (the home page or the top of the function page provides an earth language button), when this button is clicked, the page will switch to the language page.

Create a function, input text in various languages, and output text in the selected language.

My app screen shot

 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/a/4a808de6b060c124eebab49a4b662a91824105d5.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/b/bb822d12523165a4366d8e7f2690b6e22d6bc827.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/2/d2db1eeddb37ac3a3f798f55348012c95f5ae63d.jpeg)

Program screen shot  
Initially set a null value (for the first time)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/9/d95aa72e5c62c40a00a9712e7e765af7e44f4da1.jpeg)  
Open the screen to update the language Fixed component language (non-fixed component is also possible, this function can be used at any time. )  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/19c2d2b27f7cb6f814af3c333191454b17571dc8.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/ee3cdd6681820c5e8b23493c5a3e3046d7ce400b.jpeg)

Define function (only with this, other languages can be added.)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/4/645ba7df14608ebafaaa9c42e0a05d91fc8472b7.jpeg)  
The most important switcher.  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/c/9caa79b73389c540045bc43cd48b4a1d44744bbb.jpeg)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 15, 2021, 2:50pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/5 "2021-11-15T14:50:53Z")

</div>

Thanks for the input.

The issue here is that Thunkable has the `function` definition and scope is limited to the `screen` which means for an app with multiple screens you will have to create the same function in every screen but with slightly different names. This makes things a mess.

When Thunkable provides a way for **Global Functions** then such way would work for multi-screen apps.

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [November 15, 2021, 2:52pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/6 "2021-11-15T14:52:46Z")

</div>

I only need to copy the function to each page, it takes about 3 to 5 seconds, and there is no need to use a different name.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 15, 2021, 2:59pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/7 "2021-11-15T14:59:12Z")

</div>

I will never have functions with the same name in my project if they can have different codes. This is bad practice and complicates changes and modifications. **Not my cup of tea at all**.

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [November 15, 2021, 3:14pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/8 "2021-11-15T15:14:22Z")

</div>

> [@muneer](#):
>
> Global Functions

@domhnallohanlon This is needed!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 15, 2021, 3:28pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/9 "2021-11-15T15:28:35Z")

</div>

> <https://github.com/thunkable/thunkable-issues/issues/703>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> The problem …I have is that I must maintain mulitple copies of helper functions witihin project and across projects. Examples are functions to determine the type of data in a JSON object (list, string, number, object) or to determine if a variables contains a numeric value (to keep the map object from crashing from receiving a string for latitude or longitude).
> 
> As I improve these helper functions (ie change them) I must change them in EVERY screen and EVERY project. This is both time consuming and error prone.
> 
> \*\*Describe the solution you'd like\*\*
> I would like to see a section in the BLOCK screen where Global functions (either across screens, or better yet, across projects). This would work just like the current list for functions, but it would contain a list of functions which share a single definition.
> !\[image\](https://user-images.githubusercontent.com/66176281/95867263-d09b8d80-0d1d-11eb-8234-128507b54a04.png)
> 
> Where would the functions be edited? I would envision either 1) as separate dummy screen to hold the definitions (for project scoped functions) or 2) a container Project (For inter project scope
> 
> \*\*Describe alternatives you've considered\*\*
> Currently, I create projects to to hold my library of functions. When I need them in a project, I save the screen to My Screens then create a new screen based on the template. Then I copy the function into each screen that needs it. Oh, so much cut-and-paste...
> 
> \*\*Which platform are you asking for?\*\*
> Thunkable ✕ (x.thunkable.com)
> 
> \*\*Additional context\*\*
> To turn Thunkable into the fantastic commerical project (vs. educational toy) that it can be, "code" reuse is a critical feature. This would make my Thunking much more efficient.

> <https://github.com/thunkable/thunkable-issues/issues/19>
>
> At this moment the scope of functions and variables is the current screen only (…i.e. functions/variables are only 'visible' in the screen where they have been defined).
> 
> However, I have a lot of functions that perform an operation that I need on different screens (e.g. calling a web-api, doing some formatting and returning the result). This means that I have to copy the function to all screens that I need this function in. It would be much better if it would be possible to define functions that are usable in different screens.
> 
> So my feature request is as follows: allow the scope for a function to be set as 'global' or 'screen'. This way it is possible to easily re-use common functions in different screens.
> 
> Thanks!
> 
> Regards Rob
> 
> PS: While we are at it: the same would be handy for variables as well: having the option to set the scope of variables.

> <https://github.com/thunkable/thunkable-issues/issues/352>
>
> The situation:
> 
> You create a function with parameters and a result.
> Inside th…e function block you have to calculate several values by help variables (temporary variables, not needed outside). It is a logic catastrophe to use global (app) variables for this.
> And in bigger projects you loose overview. Global variables only created for temporary use in function can cause severe problems, when you use the same name outside the function.
> 
> Of course you could implement additional parameters to use them as local variables. But that is not a proper solution.
> Or you can construct a count loop that you do not use and use the names of the loop variables. But this is no real solution, because count-variables in loops also react global.
> What do you think?
> 
> So we urgently need local variables!
> 
> As a teacher for computer science and book author I have problems to teach about functions and using global variables.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [February 13, 2022, 3:29pm UTC](https://community.thunkable.com/t/adding-language-selection-to-my-app/1616219/10 "2022-02-13T15:29:07Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
