Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the keywords limited to English? #4087

Closed
xjchengo opened this issue May 31, 2015 · 11 comments · Fixed by #4097
Closed

Why is the keywords limited to English? #4087

xjchengo opened this issue May 31, 2015 · 11 comments · Fixed by #4097

Comments

@xjchengo
Copy link

I want to use Chinese keywords for my package. But it cannot pass validation:

$this->validateFlatArray('keywords', '[A-Za-z0-9 ._-]+');

And the description doesn't have this limitation.

$this->validateString('description');

It is kind of unfriendly.

@Seldaek
Copy link
Member

Seldaek commented May 31, 2015

The main reason is that we do index them in packagist and for that purpose they should be international, but technically nothing prevents you from putting Chinese in there as far as I know, it just won't pass the composer validate checks. Maybe we should downgrade this to a warning instead of error if it helps.

@xjchengo
Copy link
Author

xjchengo commented Jun 1, 2015

Packagist has this limitation too. If I use Chinese keywords, the package cannot be updated to Packagist. A lot of pacakages are limited to specified domains. If the keywords must be English, it makes the packages hard to find because many people don't know English keywords counterpart of these domains. Take it into account please.

@alcohol
Copy link
Member

alcohol commented Jun 1, 2015

Nobody is stopping you from creating a Chinese Packagist if it is that important to you. It's open source, so go right ahead. Packagist.org is focused on an international audience, and I don't want to be rude, but Chinese isn't exactly a language that is spoken world wide (yet?). If you want to release on Packagist.org, then English is the recommended language.

@alcohol
Copy link
Member

alcohol commented Jun 1, 2015

@Seldaek it seems this is already considered a warning by the way, or at least, it seems to be added to the warnings array inside ValidatingArrayLoader.

@alcohol
Copy link
Member

alcohol commented Jun 1, 2015

@xjchengo can you tell me where it does not pass validation according to you? What actions are you taking when it fails? Please give me a step by step scenario to reproduce.

@xjchengo
Copy link
Author

xjchengo commented Jun 1, 2015

The xjchen/wechat-filter package of which you are a maintainer has
failed to update due to invalid data contained in your composer.json.
Please address this as soon as possible since the package stopped updating.

It is recommended that you use `composer validate` to check for errors when you
change your composer.json.

Below is the full update log which should highlight errors as
"Skipped branch ...":

[Composer\Repository\InvalidRepositoryException]: Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches

Reading composer.json of xjchen/wechat-filter (v2.0.2)
Importing tag v2.0.2 (2.0.2.0)
Reading composer.json of xjchen/wechat-filter (v2.0.1)
Importing tag v2.0.1 (2.0.1.0)
Reading composer.json of xjchen/wechat-filter (v2.0.0)
Importing tag v2.0.0 (2.0.0.0)
Reading composer.json of xjchen/wechat-filter (v1.2.0)
Importing tag v1.2.0 (1.2.0.0)
Reading composer.json of xjchen/wechat-filter (v1.1.0)
Importing tag v1.1.0 (1.1.0.0)
Reading composer.json of xjchen/wechat-filter (v1.0.1)
Importing tag v1.0.1 (1.0.1.0)
Reading composer.json of xjchen/wechat-filter (v1.0.0)
Importing tag v1.0.0 (1.0.0.0)
Reading composer.json of xjchen/wechat-filter (master)
Importing branch master (dev-master)
Skipped branch master, Invalid package information: 
keywords.3 : invalid value (微信), must match [A-Za-z0-9 ._-]+

This is error message when updated to Packagist.
You can add a non-english keyword to reproduce.

@alcohol
Copy link
Member

alcohol commented Jun 1, 2015

Ok, so you want to submit this issue at composer/packagist then, since it is unrelated to composer/composer. I don't see how composer is doing anything wrong here.

@Seldaek
Copy link
Member

Seldaek commented Jun 1, 2015

If the keywords must be English, it makes the packages hard to find because many people don't know English keywords counterpart of these domains. Take it into account please.

That makes sense yes you're right. I think we can just drop the validation or allow all chars at least, I'll take a quick look at this.

@xjchengo
Copy link
Author

xjchengo commented Jun 1, 2015

@Seldaek @alcohol Thanks.

Seldaek added a commit that referenced this issue Jun 2, 2015
@Seldaek
Copy link
Member

Seldaek commented Jun 2, 2015

Note that it won't be fixed on packagist until I deploy a new version using latest composer, so please have some more patience :) But it'll be fixed eventually, then hopefully it won't explode the packagist search engine ;)

@Seldaek
Copy link
Member

Seldaek commented Jun 12, 2015

@xjchengo should now be fixed, please let me know if you experience any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants