MonoX Roadmap Language (override) parameter for WebParts 

Viewed 41189 time(s), 4 post(s), 9/11/2014 12:26:00 AM - by Zoomicon
9/11/2014 12:26:01 AM
2793 Reputation 345 Total posts

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"

1
9/11/2014 12:36:51 AM
2793 Reputation 345 Total posts

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)

2
12/16/2014 11:33:46 AM
2793 Reputation 345 Total posts

I ended up using Transifex Live, much easier to do localization when you have mixed content in various languages

3
12/18/2014 8:22:19 AM
3016 Reputation 428 Total posts

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.

4
This is a demo site for MonoX. Please visit Mono Software for more info.