Hi.
I am trying to create fancy and automated input dialog to choose UI language based on existing language files.
It works fine, but I would like to polish it a little bit.
Right now list in dialog shows county codes (ex. pl_PL) which are taken from filenames.
What I would like to achieve is to get on list:
Country flag + country name
instead of
Country code.
My idea to do this was presented here:
http://automagic4android.com/forum/view ... 6&t=7960&p
However it needs improvements.
1. Else{} create an "unknown" position even if there is no other element on the list.
2. Else{} create just one position on the list even if there is more unrecognized elements.
3. And maybe it can be done in different way than by loop if...else.
Do you have any advices?
Language selector
Moderator: Martin
Language selector
- Attachments
-
- What I want to get.
- SmartSelect_20190322-122348.jpg (86.35 KiB) Viewed 18760 times
-
- How does it look now
- SmartSelect_20190322-121945.jpg (57.51 KiB) Viewed 18760 times
-
- A flow.
- Screenshot_20190322-121911.jpg (624.3 KiB) Viewed 18760 times
Re: Language selector
I don't know how to add icon to the input dialog, maybe some java can do it and I am not good at it.
If you want the country name only, to be mapped to their language code, you can use the similar mapping method.
use {choice,listformat,comma} in the input dialog field
Then after getting the value, you can use langcode[value] to get the language code.
You can also reverse the key and value if you want. You can also dynamically create the key from the file list available, but you must decide the pattern first.
If you want the country name only, to be mapped to their language code, you can use the similar mapping method.
Code: Select all
langcode = newMapFromValues(
"Polski", "pl_PL",
"English (British)", "en_GB",
"Italiano", "it_IT",
"Unknown", "xx_XX" );
choice = getMapKeys(langcode);
Then after getting the value, you can use langcode[value] to get the language code.
You can also reverse the key and value if you want. You can also dynamically create the key from the file list available, but you must decide the pattern first.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Language selector
Thanks. I will try it.
FYI: Those flags are taken from emoji icons from built-in Samsung keyboard.
FYI: Those flags are taken from emoji icons from built-in Samsung keyboard.
Re: Language selector
You can add flag emojis before country names. It will show in input dialog.kamil_w wrote:Thanks. I will try it.
FYI: Those flags are taken from emoji icons from built-in Samsung keyboard.
-
- Posts: 1
- Joined: 09 Feb 2019 05:19
Re: Language selector
I was not able to understand the explaination.
can you please explain in detail
can you please explain in detail
Re: Language selector
My idea is to create a menu in Automagic, which will be activated by Automagic Destop Shortcut. It based on Input Dialog and looks this way:
Menu:
<status> <functionality>
<status> <functionality>
...
<options>
Where <status> shows if functionality is on or off, and <functionality> is a name of set of flows.
And in <options> user can choose an UI language.
I was working on it, because I wanted to learn Automagic in more advance way and I want to have a menu launched by pressing a Bixby button in my Samsung Note8.
So, safracatz, I don't understand why you write about langauge on a website.
Menu:
<status> <functionality>
<status> <functionality>
...
<options>
Where <status> shows if functionality is on or off, and <functionality> is a name of set of flows.
And in <options> user can choose an UI language.
I was working on it, because I wanted to learn Automagic in more advance way and I want to have a menu launched by pressing a Bixby button in my Samsung Note8.
So, safracatz, I don't understand why you write about langauge on a website.