MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Language (override) parameter for WebParts  (MonoX Roadmap )

43495 put(a) pogledan, 4 odgovor(a) 11.9.2014. 0:26:00Kreirao(la) Zoomicon

Povezane teme

Zoomicon

Zoomicon

11.9.2014. 0:26:01

As suggested by MZILIC at http://www.mono-software.com/Mono/Pages/Discussion/dtopic/IaGMF8XsZ0KnpqONAR-5BA/Language-parameter-for-WebParts/?tstype=SortUpdatedTopicsOnTop&dmsgId=9kmnjXqI-UqrNaOgAOtAAg#Post9kmnjXqI-UqrNaOgAOtAAg

I post a suggestion here:

"it would be nice if a language (override) parameter was added to your base webpart in the future"
</br>

e.g.

in the blog list page there is a sidebar with recent posts
</br>...in non-English pages (can check which ones are non-English by parsing the URL for /lng/xx-XX that is different from /lng/en-US easily, or check the "lng" URL parameter that your rewrite rules use if I've understood correctly from recent discussion we had in this forum)
</br>...we want to show both the list of recent posts for the localized blog
</br>... and an extra section under it with the list of recent posts from the English blog

to do that we'd pass a hardcoded language parameter to that last WebPart to be "en_US"

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

11.9.2014. 0:36:51

of course an issue we'd have is how to not show that extra webpart in the English versions of the page
</br>
</br>we can do that via Javascript (checking with a regular expression the current language from the /lng/xx_XX part of the URL or codebehind logic, but it would be nice if there was also some tag to include or skip parts of the page it wraps based on the current language

e.g. something like

<monox:include language="en_US">

...some webparts etc. markup here...

</monox:include>

and

<monox:exclude language="en_US">

...some webparts etc. markup here...

</monox:exclude>
</br>
</br>in fact such tags could support more (optional) parameters than "language", e.g. a general "test" parameter (check true/false based on some inline evaluation expression one can calculate using ASP.net markup syntax), and other specific parameters regarding page/user state (e.g. "loggedin"). If more than one of those parameters are given, they could be evaluated with an AND (and have some other optional param maybe to override this and evaluate with "OR", "XOR" etc.).

not sure if such a system already exists in ASP.net (like in JSP where there are tag extensions that allow to include a markup based on a condition)

Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
Zoomicon

Zoomicon

16.12.2014. 11:33:46
I ended up using Transifex Live, much easier to do localization when you have mixed content in various languages
Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava
imarusic

imarusic

18.12.2014. 8:22:19
It seems easy to set it and use, but please note that you do not have control anymore under the localization text because it depends on the Transifex Live.

Regards.
Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava