You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by muratsu <gi...@git.apache.org> on 2015/02/20 05:40:26 UTC

[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

GitHub user muratsu opened a pull request:

    https://github.com/apache/cordova-wp8/pull/76

    CB-8516 Support DefaultLanguage selection for WP8

    Cordova should set the appropriate project file attributes for WP 8.0 using the W3C widget spec "defaultlocale" attribute.
    
    Related JIRA: https://issues.apache.org/jira/browse/CB-8516

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-wp8 CB-8516

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-wp8/pull/76.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #76
    
----
commit 30e8b1de6e5e59a2862496dcb533b1ec0265b8bb
Author: Murat Sutunc <mu...@microsoft.com>
Date:   2015-02-20T04:37:10Z

    CB-8516 Support DefaultLanguage selection for WP8

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

Posted by muratsu <gi...@git.apache.org>.
Github user muratsu closed the pull request at:

    https://github.com/apache/cordova-wp8/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

Posted by muratsu <gi...@git.apache.org>.
Github user muratsu commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/76#issuecomment-75305949
  
    We actually don't want to merge this right now. Let's hold on until I review how winpho8 locale works.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/76#issuecomment-75211406
  
    LGTM, propose to move config parsing logic to separate file/class similar to how this is done on windows
    https://github.com/apache/cordova-windows/blob/master/template/cordova/lib/ConfigParser.js


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

Posted by nikhilkh <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org