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 )

Viewed 12040 time(s), 4 post(s) 9/11/2014 12:26:00 AMby Zoomicon

Related topics

Zoomicon

Zoomicon

9/11/2014 12:26:01 AM

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"

This content has not been rated yet. 
2793 Reputation 345 Total posts
Zoomicon

Zoomicon

9/11/2014 12:36:51 AM

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)

This content has not been rated yet. 
2793 Reputation 345 Total posts
Zoomicon

Zoomicon

12/16/2014 11:33:46 AM
I ended up using Transifex Live, much easier to do localization when you have mixed content in various languages
This content has not been rated yet. 
2793 Reputation 345 Total posts
imarusic

imarusic

12/18/2014 8:22:19 AM
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.
This content has not been rated yet. 
3016 Reputation 428 Total posts