Have you considered creating a customer provider to support additional Pseudo locales? Here is how that can be accomplished: https://blogs.msdn.microsoft.com/matdev/2014/02/24/creating-a-3rd-party-translation-provider/
4 votesAdminCameron Lerum (Sr. Software Engineer, Microsoft) shared this idea ·
The update of the official page was missed and will be corrected.
The latest Multilingual App Toolkit can be downloaded via the Tools->"Extensions and Updates" menu in Visual Studio.
Here are the direct links
Visual Studio 2015 / 2013:
I would like to learn more about the issue with the resw file needing to be the folder "strings\[Culture]". While the SDK does require a folder with the culture to identify the language, that culture is not restricted to the strings folder off the root.
To ensure it is working, I just create an UWP app and used Random\en-US as my folder structure without issue. MAT also supports the folder language-[Culture] as described here: https://msdn.microsoft.com/library/windows/apps/xaml/hh965324
What project type are you using? Many, but not all projects are supported. When the Enable & Disable menus are disabled, this is a strong indicator that the project type is not supported.
As a test, try creating a WPF or Windows Universal app as the the Enable Menu should be enabled with either of these.
Note: You will still need to configure the project for localization before the 'Add translation languages' menu is enabled.
- For WPF ensure the [assembly: NeutralResourcesLanguage("en-US")] is in the AssemblyInfo.cs file and add at least one string to the Properties\Resources.resx file.
- For Windows Universal add a 'en-US' folder. Then in that folder, add a RESW file with at least one string.
- 'en-US' is the default for most projects. Replace 'en-US' with your apps source language if different.
Work to support for ASP.net core has started.
MAT for VS 2017 provides initial support for .net core based projects. https://multilingualapptoolkit.uservoice.com/knowledgebase/articles/1142101-mat-v4-0-support-for-visual-studio-2017
The toolkit is over encoding when it puts the native code (html <strong>, <a href/> etc.) This will result in the source string encoding the related markers. As a result the translation need to contain the same markers.
When this happens, the editor will put up a fight. The quickest way to work around this issue is to place the cursor in the source field (might take a couple of tries), then select reset.
Note: This will remove your translations, but will let you edit the resource again.
XLIFF 2.0 is available export and import operations only. Using XLIFF 2.0 for the entire project is not available at this time.
We are using both recycling and machine translation to manage UI elements in the pre-release version.
I have noted the specific example and corrected it. I am investigating alternate translation source in hopes to improve the overall translation quality.
As a workaround, the editor has a command like option to override the default language. The argument is '/lang' followed by the BCP-47 code.
For example, to force English, use the following
MultilingualEditor /lang en-US
We are enabling some support for PCL in the next version of MAT. However, it has not been tested with the Xamarin environment.
The current design does not support using the same XLF file across different projects. It might be possible to use T4 scripts or some clever linking, but it is not supported directly.
My understand is that Xamarin uses the native resource models for C# based Android and iOS cross platform support. As such, I don't believe support PCL will work for your scenario.
Universal apps are supported, but at the specific project level and not the share project level. Enabling the toolkit on the Windows Store and Windows Phone project will populate the related XLF files during the build step with the resources from the shared project resource files. If you have the XLF files professionally translated, use select one project to send for translation. Then simply import the received translated XLF files into both projects to have your professional translations applied to both projects.
YES! They are very old and need updating.
Yep! Still kicking! :-)
Feel free to email me at email@example.com or CameronLerum on twitter.
Here is a //Build 2016 video that includes the Multilingual App Toolkit. https://channel9.msdn.com/Events/Build/2016/P543
This is a display issue in the editor, but the translation result is saved correctly.
The unmodified translation when used in a UWP, it works correctly. When it is used in WPF app it appears incorrect if the FlowDirection is not set to RightToLeft.
I dug into this a little deeper. The Editor UI is not displaying the translation correctly. However, the translation is correct. I have logged a bug about the editor display issue.
If this translation is used in a WPF app, please be sure to get the FlowDirection is set to RightToLeft for Persian (and other right 2 left languages).
Note: in my testing the Windows 10 apps (UWP) work correctly by default.
This has been identified as a bug in the Editor’s processing of text with a trailing new line.
As a workaround for now, when you copy text from a browser you can do one of two things to remove the unwanted newlines
After pasting the text from a browser, first delete all the unwanted newlines. Then add a single character to the end of the translation. Now delete that extra character by repositioning the cursor in front of the added character and press the delete key several times. (Not the backspace). This will remove that extra newlines that were pasted but not removed.
First copy the string to Notepad first. Then reselect the string and copy it from Notepad to the editor. Note: The copy from a browser pulls extra metadata. The second copy in notepad will remove this extra metadata.
We are change the model in v4.0, which is currently a Technical Preview. Once this v4.0 work is completed, it will allow enablement the Shared project. As such, the shared project will have its own set of XLF files, eliminating the duplication of the XLF files.
Sure, I'll take a look at the steps document and consider add it to the Knowledge Base articles.
I am not seeing this issue on my local machine running v4.0 Update 1. However, based on your comments, I believe the issue is related to a shared project not being associated with a UWP project.
Please ensure the shared projects are added via references->Add References->Shared Projects to the Windows 10 Universal app. If the shared project is not referenced, MAT will not be enabled on that project as it will not find the project's source culture. Once the shared project is referenced by the Windows 10 Universal app, it will successfully enable and the workflow will work as expected.
BTW: Adding the <DefaultLanguage> and MAT specific attributes manually to the shared project will fake MAT into allowing target languages to added. However, since shared projects are only built via the inclusion into the main project and since MAT updates the XLF and resource files during the build step, you will not received and XLF and resource updates.
Please let me know if this solves the issue you are seeing,
I was able to extract the string using the code-behind approach, which is what I believe what you are trying to accomplish.
There are a couple of items to check.
1. I am not familiar with GetResourceValue(). I used
var resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader();
String locText = resourceLoader.GetString("LocString/Text");
2. If you trying to extract a resource with a property name, the property name's period needs to be replaced with a forward slash. So the RESW ID "LocString.Text" becomes "LocString/Text" in the code-behind. Note: If no match is found, a empty string will be returned.
3. Be sure that you have applied a translation to the resource in the XLF file. If the XLF file does not contain a translation (state = 'new'), no matching entry is added to the target RESW file (fr-Fr/Resources.resw in my example). When this is the case, you will get the language fallback value.
Hope this helps,
Version 4.0 supports Windows Universal apps. We created a //Build 2015 video show how it works with Universal apps. https://channel9.msdn.com/events/Build/2015/2-90.
When v4.0 is more stable for Universal Apps, I will ensure a sample is created and published.
I’ll have looking to this and added a workaround in the comment section.
This appears to be an issue with the build environment passing "en-US" in $(DefaultLanguage) even though the app is default not “en-US” ("sv" in this case). The good news is there is an easy workaround that should work for app project types.
Assuming that your system drive is C:, please do the following:
1. As admin, edit the file “C:\Program Files (x86)\MSBuild\Microsoft\Multilingual App Toolkit\v4.0\Microsoft.Multilingual.Common.targets”
2. Change the following section from:
<!-- Handle project's with unknown source languages -->
<PropertyGroup Condition=" '$(DefaultLanguage)' == '' ">
<!-- Handle project's with unknown source languages -->
<!-- Workaround for incorrect DefaultLanguage value
<PropertyGroup Condition=" '$(DefaultLanguage)' == '' ">
3. Save the file.
4. Rebuilding your project to automatically the XLF file’s source-language value to that of your app’s actual default language.
This will force the DefaultLanguage to match the MultilingualFallbackLanguage value. Since the MultilingualFallbackLanguage is set based on your project’s default culture when it is enabled, this should work for project types.
Note: If you enabled your project before changing the default language, simply disable and enable the project again after you updated the app’s default language.
We don’t always have an consistent was to identify the source language. As such, we when don't find a default language, we use "en-US”. To ensure that the default can be changed, we write a property in the project file that will be used. To update the source language, unload and edit your MAT enabled project and look for “<MultilingualFallbackLanguage>en-US</MultilingualFallbackLanguage>”. Change this to your actual default source language. This should solve the stuck on English issue you are seeing.
I just did a clean install of Windows 10 with VS 2013 + MAT v3.1, then with MAT v4.0. I was not required to install .Net framework - and I confirmed that3.5 is it not installed.. Can you let me know your configuration so I can look into it further.
Looking into the issue with v3.1.
I looked in the behavior and confirmed the issue. This happens if the resource is mark as Translatable = 'No' and State = 'New'. If the resource State is changed to a different state, such as 'Needs review', the build does not update the target string and the Translatable value remain set to 'No'.
Once minor side-effect is that the State is changed to 'Needs review' since the source and translation strings no longer match. However, since marking the resource as Translatable = 'No' omits the string from the target resource file (To enable fallback), it does not result in any app translation issues. It does cause a string update notification, which is considered noise for this scenario.
For now, please set the State to 'Need review' to prevent the lock from being removed.