Virtual Earth 6.3 set language - virtual-earth

I am loading https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3 but I'd like to change language dynamically like if I change website language I would change language also in route.Itinerary.Segments[i].Instruction stuff... is there a way?
Thanks everyone!
Cheers
Luigi

You have to use the mkt parameter of the URL to set the culture as documented here: http://msdn.microsoft.com/en-us/library/gg427600.aspx
Note that the v6.3 control is really old and the documentation for it was taken offline a while back (thus the reason for pointing to the v7 documentation above - works for the most part with v6.3). The v6.3 control supports a very small number of languages. You should be using the Bing Maps v7 control which supports a lot more languages and has a lot more features, along with having much better performance.
As for dynamically changing the culture, you can try reloading the map control with a different mkt value by adding a script reference to your page, however this will require you to reload your map as well. Alternatively you can reload the page and change the mkt parameter of the URL using server side code.

Related

Codename One - Change language bundle after one language was already loaded

My app should enable users to change the language of the UI (for example using a language picker).
I have this line of code that works great in the init():
UIManager.getInstance().setBundle(map);
I use this code to load the default language of the device from a property file. My problem is to change the bundle with a different one during the app running. If I repeat the same line of code with a different map there is no effect.
You need to recreate the Form. It doesn't go to each label and refresh it as having it this way would require change listeners on any strings anywhere within your app and would block complex localization logic.
Just invoke the method that shows/creates your form over again and it will use the new locale.

Codename One - BrowserComponent: force page loading in a given language

Some multilingual websites serve pages in several languages, according to the browser language. Can I force BrowserComponent to ask pages in a given language (that can be equal or different from the O.S. language)?
I'm guessing this refers to setting the language in the browser which isn't something we expose at this time. It's something you can ask for via RFE. If you are aiming at a specific site that stores the data via a cookie you can probably set that via the JavaScript bridge.

Hiding the word "joomla" from a script in contact form

Whenever i create a contact form in my Joomla! 3.3.6, some script appears in the the page's HTML code that contains many words Joomla in it. I'd like to change those Joomla words and replace them with another words (i.e. Foo) for some security issue. I'd like to know whether or not i'm able to do so and how.
That script is:
<script>(function(){var strings={"JLIB_FORM_FIELD_INVALID":"\u0641\u06cc\u0644\u062f \u0646\u0627\u0645\u0639\u062a\u0628\u0631:&#160"};if(typeof Joomla=='undefined'){Joomla={};Joomla.JText=strings;}
else{Joomla.JText.load(strings);}})();</script>
I have no idea whether a plugin or an extension creates it or not.
Thank you
Regards
This script seems to be translating some text required for the form to use in its javascript, eg validation messages. It does this using a javascript version of JText, which is part of core Joomla. There is some info on how that works here. Weirdly, there seems to be little information in the official Joomla documentation about it.
The main JText function it is calling appears here: media/system/js/core.js
I'm sure it would be possible to write a plug-in to remove this script before the page is rendered and then to translate any untranslated text with your own scripts. However, I'm not sure I see any security benefit in doing this so it seems a waste of time.
Ultimately, someone sniffing a site for what it is built in is far more likely to see if core files exist by going direct to places like media/system/js/core.js, rather than to scan the code for the word "Joomla" - which would trigger a lot of false-positives (any site which just mentions Joomla) and negatives (any page which doesn't have a form on it). It also does not reveal the version of Joomla, which is the info a hacker would more likely be after.
I think you have to search for the script (i.e via Notepad++) in the whole directory. It must be a plugin for the contact form that has some inline script in it.
also do you use any special third party plugin or so? that might be the source of it.
PS: also i had some similar experience, i don't know exactly how i got rid of those words, but like you, i wanted to do that to hide the fact that i'm using joomla for security.
Its actually Joomla who add this, from the file: Joomlainstall/libraries/joomla/document/html/renderer/head.php
And load it globaly from:
Joomlainstall/libraries/cms/html/formbehavior.php
The developer ad that code by using the function, JText, for an example:
JText::_( 'COM_CONTACT_EMAIL_FORM' )
In my case it was the plugin ContactUs Form who add the javascript. If JText is not used, it is not loaded. If I disabled the plugin, the javascript was then not loaded. If you have that plugin enabled, my be try an other contact form?
For security reson it is bad programming by the developer off Joomla, for sure.

switchLanguage does not load translated item using LinguaPlone

I am still struggling getting LinguaPlone to work.
I have set up two language root folders /de (for German) and /en using /##language-setup-folders. I've created two folders, /de/texte/ and /en/articles and defined the latter as translation of the former.
In portal_languages in the ZMI I have set:
Allowed languages: English, German
Negotiation Scheme: [x] Use cookie for manual override
all other options are unchecked
I do get a language selector rendered, but when I click on "English", which calls /de/texte/switchLanguage?set_language=en, I get an English UI, but the location is still /de/texte.
And even though the breadcrumbs say You are here: Home › texte, Home actually still points to /de instead of /en.
I've searched the web, but apart from some older rant on LinguaPlone I could not find what I've been possibly missing.
How do I configure LinguaPlone to actually load the linked translation when switching languages?
Edit:
Plone 4.0.2
Zope 2.12.13
LinguaPlone 4.0
You have indeed the wrong language selector. There have been recurring reports about this but so far nobody found out why and how it happens. The correct language selector overrides the Plone default one by being defined for the ILinguaPloneProductLayer layer. This browser layer should be active as soon as you have the "LinguaPlone" skins folder as part of your skin layers.
You could try to reorder the skin layers in your theme by going to "http:///portal_skins/manage_propertiesForm" and moving LinguaPlone to the top, right after "custom".
If you have a theme of your own and defined any extra browser layers, those could possibly interfere as well, but it's hard to tell in what exact ways.
I think you have the wrong language selector.
There is a basic language selector viewlet that is shipped with Plone ("plone.app.i18n.locales.languageselector" in plone/app/i18n/locales/browser/configure.zcml). It just switches the language of the Plone interface (not the content). This is the language selector that links to "switchLanguage".
When you install LinguaPlone, it overrides the Plone language selector with it's own.
The LP selector is not supposed to link to "switchLanguage", but the URL of the content item in the target language (with the ?set_language parameter).
This viewlet is defined in Products/LinguaPlone/browser/configure.zcml
Perhaps LP is not correctly installed, or something is overriding the viewlet ?
The reason for this behaviour is that LinguaPlone 4.0 is not compatible with the "Plone Classic Theme" on Plone 4.0.2.
Switching to the "Sunburst Theme" solves the problem: the language selector links point to the correct URIs then.

How to register a custom view engine in magellan?

I'm all new to magellan, and as an attempt to learn it, I've built a custom view engine for supporting windows forms as specified in the documentation at codeplex.
But how to register this new ViewEngine? There it is given,
ViewEngines.Engines.Add(new FormsViewEngine(new DefaultViewActivator()));
But what I can see is that, ViewEngines is not a Static Class and moreover it does not have a Engines Property. I know I'm missing something, but what is it?
So, How to register my ViewEngine to Magellan? Where and When should I register it?
PS: I'm using the latest update of magellan.
You are correct, the view engines are now configured on the ControllerRouteCatalog.
One of the goals in Magellan 2.0 was to reduce the number of static locators.
Seems like things have changed a bit. A few search for references of ViewEngine Class in the Magellan source gave the answer.
Now ViewEngines just provide default collection and no more handles ViewEngine registrations. I managed to create my own ViewEngineCollection and pass it to the contructor of ControllerRouteCatalog.
My bad, I should have done that before. Thanks anyway.

Resources