I have an application in Windows Phone 7.0 and now I want to make it multilingual supporting both English and French languages.
Could anybody guide me through the approach I should follow for supporting it in multilingul.
Thanks
SAM
The recommended approach is to expose any ResourceManager instances as XAML Resources (via a wrapper class, since the resources are only available at runtime). You can then bind to the properties of the strongly typed ResourceManager in XAML.
Here is some documentation that might help:
How to: Build a Localized Application for Windows Phone
Globalization and Localization for Windows Phone
And some other resources to help:
PhoneCommonStrings contains strings commonly used in WP7 applications, localized to all available languages (disclaimer: I'm the author of the library)
BindableApplicationBar allows you to bind the text (and command) of your application bar buttons
Look at my blog: I just wrote about this very subject a couple weeks ago. It gives you step-by-step instructions.
Basically:
Create the project
Edit the .csproj file in notepad to add the desired cultures to the tag.
Select a neutral culture in the project's properties
Add Resources to the project in Solution Explorer
Create a class to access those resources
Add that class to the tag of the App.xaml file
Put your strings into the Resources file
Bind to those strings using the resource binding in your xaml.
If using an ApplicationBar, you must do so in code, as it cannot be bound in xaml.
Create another resource file for each supported culture.
Create dll files for each supported language, so the title will be correct on the tile and program list.
Related
I finished a new WP7 app and I made it possible to switch to different languages via custom code.
I'd like to add English and French, currently it is only set to German.
When I try to submit it to the marketplace, I only have the option to fill out the german info, but how can I declare my app to be also available in EN and FR?
See the HowTo: on MSDN.
The idea: If you have resources for supported languages, you need to declare them in .csproj file
<SupportedCultures>de-DE;fr-FR;us-EN;</SupportedCultures>
Thanks to Anton I came to the solution:
If you end up like me, do this to add different language support for your app manually (without filling out resources):
Create new resource items in your project and call them AppResources.en-GB.resx etc. It should fit to the syntax. You don't need to fill out or explicitly use those resource files.
After that, you go to your .csproj file of your project and add (see above posts) those language infos into it. Then, you'll see that the marketplace recognizes those languages.
I just tried to submit my new Windows Phone 7 app to the Market Place and realized that apparently I have set English as my project language instead of German. In the app hub application submission walkthrough - step 2 it says
Provide the following information to submit your application. You'll repeat these steps for each language that your XAP package supports.
And in the next page as the only "supported language" English is shown.
How can I put German instead?
Thanks
PS: Does it even matter? What if I just provide a German description even though it says English?
Your changing the native language of the app. Open properties of your project, get the assembly info and you should see a list of languages (I'm not exactly sure as dont have VS on this machine).
The other option is to add / change the NeutralResourcesLanguageAttribute in the assemblyinfo file. The new version would look like:
[NeutralResourcesLanguageAttribute("de")]
I'm using MVVM Light in my Windows Phone 7 application. The application is to be used in English and Spanish. Users can select a different language during runtime. I'm localizing the application using resource files. I've already been able to make the localization works, but only when I change the language from Settings. In the main page, I have a list for users to select the language during runtime, I'm setting the selected language to Thread.CurrentThread.CurrentCulture, but the text strings in the interface don't get updated. I have a set of properties in the ViewModel that I'm binding to the View to set the labels of the control, but something is missing. I've been reading that I need to implement the INotifyPropertyChanged in the ViewModel to make this works, but I don't know how to exactly do that nor if there is a different better way to implement this case using MVVM Light. Could anybody help me here please?
Hum, I wrote a blog post about it sometimes ago ( http://wp7wonders.wordpress.com/2010/10/17/localize-a-windows-phone-7-application/ - read the comments too!). The main point is that you have an object between the resource files and your viewmodels which allow to change the dynamically the language.
I have noticed that when i change phone settings, that some of the applications on the phone change their name based on selected language.
eg. Where you change phone settings is Settings (english), Parametres (french), Configuracion (spanish)
Does anyone know how to do this for my own application?
I can change the strings inside my application. I want to change the application name that is displayed beside (or overtop) the application tile.
Microsoft wrote a detailed guide on how.
And yes, it's a C++ satellite DLL. You're not reading it wrong.
Consider using Patrick Getzmann's Tool to automate the satellite generation
We're working on creating a specialized graphical editor for our enterprise applications. We've looked at and rejected DSLs. Ideally I'd like to have the main interface of the editor be docked like the code windows and use WPF for drawing. Can anyone point me to some documentation to get me on the right path?
Thanks.
Colin.
UPDATE: It's beginning to look like "no." From http://msdn.microsoft.com/en-us/library/bb166228.aspx: "Document windows are created by implementing an editor. The IVsEditorFactory interface creates document windows as part of instantiating an editor. For more information, see Accessing the Editor By Using Legacy Interfaces."
Following the link to http://msdn.microsoft.com/en-us/library/dd885127.aspx gives this this bit of advice: "You can access the Visual Studio editor from legacy interfaces. The Visual Studio SDK includes adapters known as shims, which enable these interfaces to interact with the new editor. Nevertheless, we recommend that you update your legacy code to use the new editor API. Your code will perform better and you can use new technologies such as the Windows Presentation Foundation (WPF) and the Managed Extensibility Framework (MEF)."
So, to sum up: if you want to implement an editor you have to use the legacy interfaces, but you shouldn't use the legacy interfaces because then you can't use WPF or MEF.
Seriously Microsoft, WTF?
UPDATE 2: Now that I have the proper names ("custom editor"), I was able to find the following topic: http://social.msdn.microsoft.com/Forums/en-US/vsxprerelease/thread/9e605d0f-1296-47c9-a534-e54905251ebe
I still don't see why they couldn't have included that somewhere prominent in the MSDN docs. You know, like somewhere near where they tell you that you can't use WPF if you're using the legacy interfaces.
Creating a custom editor doesn't have to be terribly painful. Yes, a custom editor will require implementing a few interfaces, but you can still use WPF to actually create the control that is hosted in the VS document frame.
DiveDeeper's blog has some great resources for learning about creating a custom editor.
Creating a simple custom editor - the basics
Creating a simple custom editor - the first 10 meters
Creating a simple custom editor - under pressure
I'd recommend using a library like VSXtra to do a lot of the work for you. It will provide you with a nice base implementation of an editor factory, editor pane, package, etc. Istvan Novak writes about building a custom editor with his VSXtra library in this blog post.