Hey all, I'm trynna create a shared component that is gonna serve as I translator text. Basically, I created a list on SharePoint that I search for id and text and get a translated text to replace the content on app. For example, if the user set the language up to English, the login button's text will appear"Login", the same for portughese "Acessar" and so on. I created a flow that filters the appropriated text bassed on id and language passed and returns the result (the translated content).
That's the flow and the idea was to create a shared Text Component which could execute this flow and get the result (the translated text). So, every time I call it, I would pass the parameter TextId only, and the component, in its Text property, would return the translated text.
I already have a function that does this
First(
Filter(Translations, LanguageTag = LanguageId && TextId = "LoginId")
).LocalizedText
but I need to pass it for every element in all screens, e.g: button, text, input. Therefore, I'd love if it was possible to create a component Text to be used wherever on the app.
This is to create a Text component only, it's not applicable to buttons, inputs or other elements. If you don't get what I meant, plase follow this video that I used as an example.
Solved! Go to Solution.
Hello @felipepazts
In your component, enable the Access App Scope so it can access your app's data. By design components are isolated so you need to enable that option.
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION. This helps community members if they experience a similar issue in the future. |
bistek.space @cha_bistek @BisTekSpace |
Hello @felipepazts
Your progress is really good but I would recommend trying to lessen your flow call as this will result in a laggy experience. Your planned design route will make multiple flow calls.
I would highly recommend that you build up a flow that will fill a local collection in your app to store all the translations so that you call the info within the App. For example
On Apps OnStart, you just use English. Like you can have a collection of English words
Then when the user changes language it will trigger to translate all your English words and add the translated words to your collection. Can use AddColumns here.
then on your control's Text property to be like
If(Translate,LookUp(col,ControlID=ButtonA).TranslateResult,LookUp(col,ControlID=ButtonA).English)
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION. This helps community members if they experience a similar issue in the future. |
bistek.space @cha_bistek @BisTekSpace |
Thanks for replying to me, @cha_cha . I tried something similar to this, however, I couldn't read the collection inside the component. The idea is to pass the textid to the component and inside it, to run the Lookup, Filter, whatever function.
The image below is related to the component I've created and as you can see, it can't find the translations collection.
Hello @felipepazts
In your component, enable the Access App Scope so it can access your app's data. By design components are isolated so you need to enable that option.
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION. This helps community members if they experience a similar issue in the future. |
bistek.space @cha_bistek @BisTekSpace |
Hey @cha_cha
Is there any extra config to enable this property?
Just a reminder, this is how my shared componet library looks like
I'm working on the LabelMultipleLanguage and inside it I have a Text label component.
@cha_cha , I was looking for this flag here and I discovered that this is enabled in component tab, however, I'm using the shared component library. So, my question now is: what is the difference between the components created on the app (components tab) and the components created such as a shared component
The components I was trying to implement have been created on the Component libraries, nonetheless, this feature you mentioned above it's only possible to be accessed from the components tab inside the app.
Hello @felipepazts
For your requirement, please create the component within the App.
Shared Components are designed to be shared across different apps in an environment. They are by default isolated to ensure that they have no dependency on certain data sources. Most common function Shared Component are like App Banner, Footer. But I think it can do more but I don't have experience in that part yet.
Components can be created in a Shared Component way (isolated) or you can allow it to access the app's current data. This action actually builds dependence on app so it can't be easily shared with other apps who don't have database.
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION. This helps community members if they experience a similar issue in the future. |
bistek.space @cha_bistek @BisTekSpace |
User | Count |
---|---|
251 | |
102 | |
94 | |
47 | |
37 |