[Mon_s] 3 letters work around

Continuing the discussion from [Setting up the weather]

(Setting up the weather - #11 by 1980borsan):

Since its off topic i have created/ reply here.

You could do ([MON]==1)? JAN : (([M0N == 2) ? FEB : (([MON]==3) ? MAR :…))

A nested if else for all the months in your language.

@1980borsan

The get these from a internet library and they shortened months and days aren’t always correct.

What you can do is create a bitmap image and instead of the month name use the month number then remap it.

Hope this helps, If you don’t understand here is a blog that may explain it better. You can scroll down to the bitmap part but the whole thing is useful.

Ron
Samsung Developer Relations

Hi yup this is easier. Forgot about bitmap font

In Estonian, [Mon_s] is displayed in full. Is it possible to add language editing? It is not convenient to make multilingual digital units.
BsSportRUS_1698891462646

bitmap image can be used, as I understand it, for one language

How many languages do you need to support?

Hi, @1980borsan you could try. Adding something like this

(([LANG_LOC]==“en_US”)) with the tag example i gave.

E.g (([LANG_LOC]==“en_US”)) ? (([MON]==1)? JAN : (([M0N == 2) ? FEB : (([MON]==3) ? MAR :…))) : …

Super long tag expressions formula but might help

en_US - and where can I find out the list of abbreviations of languages?
How to write down your formula correctly? - (([LANG_LOC]==“en_US”)) and ([MON]==1)? JAN : (([M0N == 2) ? FEB : (([MON]==3) ? MAR :…)) ?

Hi, read this first

Scroll to Relational operators and Ternary operators.

For locals

https://www.localeplanet.com/icu/

1 Like

I guess this would be too selective. Lets say I want abbreviations in English and German but the tag diferentiates 7 German locales and maybe 50 of English. I only need 2 sets of abbreviations to cover them all, but the conditional line would be mile long to not exclude any possible locale.

Like no choice, for now , submit a feature request?
E.g a string format

I.e stringformat([MOM_F],3)

What the maximum layers can u have in wfs?

What i can think of is spilt tags expression into layers. And play with opacity. So if layer supports a local make it 100% the rest 0% opacity.

Layer 1,
So in opacity tag you can have.
0+(([LANG_LOC]==“en_US”))+[LANG_LOC]==“en_Uk”)))*100

Layer2,
Can be for german.

Etc

And in tag for text just do one main language

But yes even with this still alternative we cant cover all languages types its way to many. This Just maybe makes the tag expressions look shorter for each languages.

The true solution would be if we could have truncate function similar to the numberFormat, like you put it stringFormat. I suggested it earlier.

My personal favorite workaround is masking. I use monospaced font so the desired string has always same length, align it to the left and place image mask over it. Good is, that in WFS each text layer can have individual mask, which wont obstruct other nearby layers. Trouble is, that some devices handle the fonts differently and the preview alignment does not always match the real text position on the display.

I thought of masking by aligning text to right first then removed the other characters…but like you say some times the length may be different in different languages… e.g chinese. 二月 = Feb

@1980borsan and @Peter

Mainly to @1980borsan, if you find its to long to type for all local. Not sure if all local doesnt produce correctly anot.

My suggestion is test it out. And only write tag expression for exceptions.

E.g for me i use english language, all months are ok except sept

So i am thinking to do this

(([MOM]==9)? Sep: [MOM_S])

1 Like

In theory since I’d have to change my phone to Russian to test this
Create a clocks stacked one on top of the other
one with only the Russian Language clock and no others
also for what ever other language doesn’t work right such as Portuguese or UK English
Those clocks will only show when the country is Russian, Portuguese or UK English
Then a clock with US Default and other localized countries

In theory it will work.

Ron
Samsung Developer Relations