[
https://issues.apache.org/jira/browse/CB-8516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14329453#comment-14329453
]
ASF GitHub Bot commented on CB-8516:
------------------------------------
Github user nikhilkh commented on a diff in the pull request:
https://github.com/apache/cordova-wp8/pull/76#discussion_r25098154
--- Diff: template/cordova/lib/build.js ---
@@ -68,6 +70,40 @@ module.exports.run = function (argv) {
}
return parseAndValidateArgs(argv)
+ .then(function(buildopts) {
+ var csProjFilePath = shell.ls(path.join(ROOT, '*.csproj'))[0];
+ var WMAppManifestFilePath = path.join(ROOT, 'Properties',
'WMAppManifest.xml');
+ var AssemblyInfoFilePath = path.join(ROOT, 'Properties',
'AssemblyInfo.cs');
+ var configFilePath = path.join(ROOT, '..', '..', 'config.xml');
+
+ var configContents = removeBOM(fs.readFileSync(configFilePath,
'utf-8'));
+ var configXML = new et.ElementTree(et.XML(configContents));
+ var defaultLocale = configXML.getroot().attrib['defaultlocale'] ||
'en-US';
+
+ // Change locale on csproj file
+ var csProjContents = removeBOM(fs.readFileSync(csProjFilePath,
'utf-8'));
+ var csProjXML = new et.ElementTree(et.XML(csProjContents));
+ var csProjDefaultLocale =
csProjXML.find('./PropertyGroup/SupportedCultures');
+ csProjDefaultLocale.text = defaultLocale;
+ fs.writeFileSync(csProjFilePath, csProjXML.write({indent: 2}),
'utf-8');
+
+ // Change locale on WMAppManifest file
+ var WMAppManifestContents =
removeBOM(fs.readFileSync(WMAppManifestFilePath, 'utf-8'));
+ var WMAppManifestXML = new
et.ElementTree(et.XML(WMAppManifestContents));
+ var WMAppManifestLanguages =
WMAppManifestXML.find('./Languages/Language');
+ WMAppManifestLanguages.set('code', defaultLocale);
+ var WMAppManifestDefaultLanguage =
WMAppManifestXML.find('./DefaultLanguage');
+ WMAppManifestDefaultLanguage.set('code', defaultLocale);
+ fs.writeFileSync(WMAppManifestFilePath,
WMAppManifestXML.write({indent: 2}), 'utf-8');
+
+ // Change locale on AssemblyInfo file
+ var AssemblyInfoContents =
removeBOM(fs.readFileSync(AssemblyInfoFilePath, 'utf-8'));
+ AssemblyInfoContents = AssemblyInfoContents.replace(/[\w\[:
]+NeutralResourcesLanguageAttribute\("[\w\-]+"\)]/,
--- End diff --
Changing the NeutralResourceLanguageAttribute does not look like the
correct thing to do here.
> Support DefaultLanguage selection for WP8
> -----------------------------------------
>
> Key: CB-8516
> URL: https://issues.apache.org/jira/browse/CB-8516
> Project: Apache Cordova
> Issue Type: Improvement
> Components: WP8
> Reporter: Murat Sutunc
> Assignee: Jesse MacFadyen
>
> The widget spec (http://www.w3.org/TR/widgets/#the-defaultlocale-attribute)
> supports "defaultlocale" attribute.
> Cordova should set the appropriate project file attributes for WP 8.0 using
> the W3C widget spec "defaultlocale" attribute.
> In the case widget is missing "defaultlocale" attribute, it should default to
> "en-us".
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]