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

Japanese support #46

Closed
dmyers opened this issue Oct 30, 2014 · 7 comments
Closed

Japanese support #46

dmyers opened this issue Oct 30, 2014 · 7 comments

Comments

@dmyers
Copy link

dmyers commented Oct 30, 2014

Is there a way to get Japanese characters to work?

@mac2000
Copy link
Contributor

mac2000 commented Oct 31, 2014

All you need to do (If for some reason you can not make pull request) is:

  1. Provide transliteration rules, e.g. 'ї' => 'ji' in any format
    (they will be added to src/Slugify.php rules array)
  2. Provide tests cases, e.g. 'Україна' => 'Ukrajina'
    (they will be added to tests/SlugifyTest.php data provider array)

Hope that helps

@picks44
Copy link

picks44 commented Sep 20, 2016

+1 for the addition of the Japanese

1 similar comment
@xoco70
Copy link

xoco70 commented May 3, 2017

+1 for the addition of the Japanese

@SuN-80
Copy link
Contributor

SuN-80 commented Oct 31, 2017

I gave it a try some months ago and it's more complicated to implement than Chinese. But I've stopped working on this because nobody was able help me understand why my Chinese pull request failed 2 checks, while it works perfectly (#158).

@wandersonwhcr
Copy link
Contributor

Please, can you rebase your branch to master?

@EraYaN
Copy link

EraYaN commented May 3, 2018

Something like

transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();", $string)

Already transliterates some Japanese, although kanji is still very much an issue, It seem to just take the first reading it can find.

A better option would probably be something like MeCab.

Some example implementations:
https://github.com/MikimotoH/furigana
https://ankiweb.net/shared/info/3918629684

It does add a C++ dependency: https://github.com/taku910/mecab
There seem some PHP binding projects like this: https://github.com/rsky/php-mecab

This could do a runtime check and keep current behaviour if it is not available, and enable it when mecab is available.

@DemigodCode
Copy link

I think that issue can be closed.

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

No branches or pull requests

8 participants