Skip to content

Chinese support #269

@echo-LuGuang

Description

@echo-LuGuang

I discovered this great project in Laravel News today, but after using it, I found that it is not friendly to Chinese support.

image image
// CreatesNewMarkdownPostFile.php

public function __construct(string $title, ?string $description, ?string $category, ?string $author, ?string $date = null, ?string $customContent = null)
    {
        $this->title = $title;
        $this->description = $description ?? 'A short description used in previews and SEO';
        $this->category = $category ?? 'blog';
        $this->author = $author ?? 'default';
        $this->customContent = $customContent;

        $this->date = Carbon::make($date ?? Carbon::now())->format('Y-m-d H:i');
        $this->identifier = Str::slug($title);   // <--  here
    }
dump(Str::slug('你好世界', language: 'zh-CN')); // ✅
dump(Str::slug('你好世界')); // ❌
### Tasks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions