You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by dpogue <gi...@git.apache.org> on 2016/06/05 04:29:32 UTC
[GitHub] cordova-lib pull request #453: Support a display name via config.xml
GitHub user dpogue opened a pull request:
https://github.com/apache/cordova-lib/pull/453
Support a display name via config.xml
The W3C Widgets spec allows for a `short` attribute on the `<name>` element in config.xml, which is to be used for a display name:
https://www.w3.org/TR/widgets/#the-short-attribute
This adds a new `shortName` function to ConfigParser, which will return the value of that attribute, falling back to returning the content of the `<name>` element.
The `setShortName` function will attempt to set the attribute on the `<name>` element to the specified value. If the `<name>` element does not exist, it will be created with both the text content and the `short` attribute having the specified value.
I've updated the legacy/compat project metadata helpers here, and will open pull requests against the Platform API projects. I'm not entirely sure how to best approach that given the API addition to ConfigParser. Maybe it's best to test for the existence of the `shortName` function before calling it?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dpogue/cordova-lib short-name
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/453.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 #453
----
commit 785c3caafdd09cc5f0a9022d78663c8399575862
Author: Darryl Pogue <da...@dpogue.ca>
Date: 2016-06-05T03:34:51Z
[CB-11120] Allow short/display name in config.xml
This adds support for a "short" display name to be specified as an
attribute of the `name` element in config.xml.
This attribute is defined in the W3C Widgets spec, on which config.xml
is loosely based:
https://www.w3.org/TR/widgets/#the-short-attribute
commit 83f1a01b22d9e68130613d53a4a28eadc0d32a24
Author: Darryl Pogue <da...@dpogue.ca>
Date: 2016-06-05T04:20:11Z
[CB-10916] Support display name for iOS & Android
----
---
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-lib issue #453: Support a display name via config.xml
Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the issue:
https://github.com/apache/cordova-lib/pull/453
The `lang` attribute might not be too bad for implementing this... the main problem comes down to how we handle the API for getting those localized names. We probably need to support localized app names and display names, since both can be used in the UI in different places.
Maybe `ConfigParser.localizedNames()` and `localizedShortNames()` could return a JSON object of all the additional localizations like `{"fr": "Bonjour Cordova", "jp": "\u4eca\u65e5\u306f \u30b3\u30eb\u30c9\u30d0"}`?
---
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-lib issue #453: Support a display name via config.xml
Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the issue:
https://github.com/apache/cordova-lib/pull/453
Can we merge this in?
---
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-lib issue #453: Support a display name via config.xml
Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on the issue:
https://github.com/apache/cordova-lib/pull/453
@shazron don't think we should as `edit-config` can add/modify the strings.xml file on Android just as easily as AndroidManifest.xml.
---
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-lib issue #453: Support a display name via config.xml
Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on the issue:
https://github.com/apache/cordova-lib/pull/453
@dpogue take a look at this PR https://github.com/apache/cordova-lib/pull/449. It should allow for the editing of anything in AndroidManifest.xml. Currently it works for plugin.xml but the plan is to add config.xml support as well.
Better to have a generic way to target things in AndroidManifest.xml and pList rather than adding one off features.
---
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-lib issue #453: Support a display name via config.xml
Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the issue:
https://github.com/apache/cordova-lib/pull/453
Windows has a `WindowsStoreDisplayName` preference, but I'm not clear if it's the same concept or not.
In any case, the proper place for the platform changes should happen in each of the platforms with PlatformApi. I only updated the Android/iOS ones here because it wasn't as clear at the time.
---
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-lib issue #453: Support a display name via config.xml
Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the issue:
https://github.com/apache/cordova-lib/pull/453
I think we should as shortName is part of the W3C Widget spec
---
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-lib issue #453: Support a display name via config.xml
Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the issue:
https://github.com/apache/cordova-lib/pull/453
This is cool, I just worry about how we handle localization of the app display name.
All platforms support having multiple sets of metadata for different markets, and I would like to see a solution that handles this as well. The widget spec recommends an xml:lang attrib which I find a bit awkward. Not sure what other options there are.
---
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-lib issue #453: Support a display name via config.xml
Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the issue:
https://github.com/apache/cordova-lib/pull/453
I think we should support this in the simplest way possible with a consistent API, as opposed to requiring people to add several unintuitive blocks of `edit-config` to modify various platform-specific files.
---
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-lib issue #453: Support a display name via config.xml
Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the issue:
https://github.com/apache/cordova-lib/pull/453
## [Current coverage][cc-pull] is **80.53%**
> Merging [#453][cc-pull] into [master][cc-base-branch] will increase coverage by **<.01%**
```diff
@@ master #453 diff @@
==========================================
Files 68 68
Lines 5389 5394 +5
Methods 851 851
Messages 0 0
Branches 1043 1044 +1
==========================================
+ Hits 4339 4344 +5
Misses 1050 1050
Partials 0 0
```
> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [79cfdfd...9fbebc3][cc-compare]
[cc-base-branch]: https://codecov.io/gh/apache/cordova-lib/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/apache/cordova-lib/compare/79cfdfd9ca11e25fef31917e8165bb12e4f8c34c...9fbebc356bbfd02c6a24d8a389a18398440ed8b4
[cc-pull]: https://codecov.io/gh/apache/cordova-lib/pull/453?src=pr
---
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-lib issue #453: Support a display name via config.xml
Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the issue:
https://github.com/apache/cordova-lib/pull/453
@macdonst I would agree if this were platform-specific, or outside the scope of the W3C Widgets spec, but this is a fairly common request in JIRA and the spec supports it reasonably gracefully. I'd rather provide a simple way of setting a display name rather than forcing people to add a bunch of overrides to their config.xml for each platform.
Even with the ability to edit AndroidManifest.xml from config.xml, that actually wouldn't help in this case because it's the strings XML file that needs updating.
---
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-lib issue #453: Support a display name via config.xml
Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:
https://github.com/apache/cordova-lib/pull/453
Hmm. `edit-config` still hasn't been implemented for `config.xml` and might not for a while. I can see both sides of the argument.
One of the main goals for `edit-config` was to have a generic way to add elements to config files and not have to create new config elements for every new preference that pops up. Adding this is counter-intuitive to that goal.
On the other hand, for `edit-config` this would require multiple lines to do. One for Android, one for ios, etc. Most users probably wouldn't use/set shortname in this scenario. If this is a feature we want many users to use, it might be better to make it its own preference.
What are others peoples thoughts? I'm going to hold off including this in 6.5.0 so we can discuss it more. Thoughts @macdonst @purplecabbage @infil00p @shazron?
Side note: Does windows not support a shortname type attribute? I only see additions to iOS & Android in this PR.
---
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-lib pull request #453: Support a display name via config.xml
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cordova-lib/pull/453
---
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-lib issue #453: Support a display name via config.xml
Posted by macdonst <gi...@git.apache.org>.
Github user macdonst commented on the issue:
https://github.com/apache/cordova-lib/pull/453
@dpogue yeah, I agree that it is a common use case. One reason I bring it up is you may be able to re-use some code that @ktop is landing into cordova-common. Also, I mis-spoke as Karen's changes can edit strings.xml and other xml files as well.
---
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