I need to know how to use the new component, how the strings.xml could be structured
Well, thanks for sharing. But it is not clear to me because it does not work and all the components disappear
Because your join is supposed to be like this ColinTreeSysLanguage1.SysLang_hello_world
.Edited out just reread the steps. Like this:
In my Strings.xml
I have this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="eng_screen1_title">Eh</string>
<string name="spa_screen1_title">Eh</string>
<string name="ita_screen1_title">Eh</string>
<string name="hun_screen1_title">Eh</string>
</resources>
JUST A NOTE
It doesnât work on Emulators or the Companion, itâs required you test on a real device with the APK have been Built.
Well, Iâm not a baby ⌠just that Iâm not on the backend side and I do not really know how it works, I see that itâs very âpersonalizedâ, so thereâs nothing wrong with asking if thereâs still no documentation, or ask for an example project
WowâŚ
The same says the component by herself if you use it with companionâŚ
where do i get the list of language code like - eng_ , spa_ , ita_ etc.
Just use the device tools component.
Nobody must use any other extension for that because we already can return the device language/country.
Example:
The file name must be current: âstrings.xmlâ.
And the content must only be strings like below:
<string name=âen_forward_targetâ>Hello</string>
<string name=âes_forward_targetâ>Hola</string>
<string name=âde_forward_targetâ>Hallo</string>
<string name=âen_404â>There was a problem</string>
<string name=âes_404â>HabĂa un problema</string>
<string name=âde_404â>Es ist ein Fehler aufgetreten</string>
It is recommended to use this component just for testing and not for production since the blocks will be changed soon for a stable component.
one more help @mika,
here in eng_screen1_title - eng is the system language code and _screen1_title is the string name to fetch the data from xml file right?
i tried this and its not working, can you please check,
file name - strings.xml
xml file content -
<string name="en_label">Hello</string>
<string name="es_label">Hola</string>
<string name="hi_label">नऎसŕĽŕ¤¤ŕĽ</string>
blocks -
output -
i tried your guide, but still didnât work, instead of getting output from xml file, resource name is printing. i think i should wait for the stable version,
Because of this:
Look at the point: âIf Resource Not Found UseââŚ
You added there âen_labelâ this will be your text if the resource can not be found.
And now read the guide complete:
Correct.
i read it properly, and to make sure i get the good result i also used your example.
i also want to test this component properly, so sorry if i am bothering you.
Block -
XML file structure -
output-
Read it please again
Good. I thought that the component has many errors ⌠I just added it, all the elements on the screen disappear in Companion, but in the compilation it appears. It was because the Companion App has an update (nobody told me). Even so, that component in Companion is not allowed to be used. I hope so in the future.
Then ⌠in the string.xml where it will contain the language texts, it will have a structure as mentioned by Diego:
Then in Kodular Creator the SUPER BLOCK is used to check two things: if in the .xml file it has the following ID (ID of the device language + â_exampletextâ), then it loads the text âHelloâ or the language that I detect and that have the text If you do not have that text, then load this âHelloâ string or whatever else you put in it. This detects two things, if it is an ID of a text, or if it is a text, putting as priority 1 the ID and 2 the text.
Here it collects the ID (es) + _hello; if not a text âHelloâ:
Here it collects the ID (es) + _hello; if not an ID en_hello:
Note: the .xml file should be called only strings.xml, not otherwise. The component âResource File (strings.xml)â. This component is still test, so it only works in compilations, not in Companion or emulators. I have had problems loading the string.xml, just load parts and others display them as âxx_xxxxâ
Strings.aia (3,8 KB)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.