-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add Chinese Simplified (zh-CN) Lorem and Text provider #1376
base: master
Are you sure you want to change the base?
Conversation
Lorem has moved to another repo https://github.com/ganlvtech/faker-chinese-lorem . The base text was written in 1926, and the previous link was wrong by my mistake. I have fixed it. Now, it reference to a correct location. |
"Text::utf8_strlen" is not in camel caps format "Text::utf8_chars" is not in camel caps format
|
/** | ||
* Get UTF-8 string characters array | ||
* | ||
* TODO: this function is not used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this method in here when it is not used? And in general speaking i dont think such a method even belongs in a locale. If it belongs somewhere then it would even be in the core itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function utf8Chars
is a fallback for explode
. I don't know if preg_split
with /u
works well for utf8 text. So I provide a fallback function. But it's actually not used.
* | ||
* @return int | ||
*/ | ||
protected static function utf8Strlen($text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wont the php native mb functions handle this properly nowadays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to change all this messy code to mb_*
function. But there is no ext_mbstring
in package.json. So I don't use these functions.
@pimjansen What do think about adding |
@ganlvtech not a fan of this since it would mean a breaking change. We are not allowing it till we start with Faker 2.0 later this year. So for 1.x we cant |
Any update? |
No description provided.