docs(contributing): 删除贡献指南文档

This commit is contained in:
gouguoyin
2025-11-14 21:52:43 +08:00
parent ce7ee82b73
commit 026981ba0e
4 changed files with 0 additions and 480 deletions

View File

@@ -1,120 +0,0 @@
# Carbon 本地化语言贡献指南
## 如何为 Carbon 添加新的本地化语言支持
### 一、复制语言模板文件
```bash
# 从 lang/en.json 复制作为模板
cp lang/en.json lang/xx.json
```
其中 `xx` 是您要添加的语言的 `ISO 639-1` 语言代码(如 `zh-CN`、`ja`、`ko` 等)
### 二、更新模板文件内容
编辑新创建的 `lang/xx.json` 文件,将所有英文内容翻译为目标语言,以下是一个完整的 `简体中文` 语言文件示例:
```json
{
"name": "Simplified Chinese",
"author": "https://github.com/your-username",
"months": "一月|二月|三月|四月|五月|六月|七月|八月|九月|十月|十一月|十二月",
"short_months": "1月|2月|3月|4月|5月|6月|7月|8月|9月|10月|11月|12月",
"weeks": "星期日|星期一|星期二|星期三|星期四|星期五|星期六",
"short_weeks": "周日|周一|周二|周三|周四|周五|周六",
"seasons": "春季|夏季|秋季|冬季",
"constellations": "白羊座|金牛座|双子座|巨蟹座|狮子座|处女座|天秤座|天蝎座|射手座|摩羯座|水瓶座|双鱼座",
"year": "%d 年",
"month": "%d 个月",
"week": "%d 周",
"day": "%d 天",
"hour": "%d 小时",
"minute": "%d 分钟",
"second": "%d 秒",
"now": "刚刚",
"ago": "%s前",
"from_now": "%s后",
"before": "%s前",
"after": "%s后"
}
```
#### 字段说明
| 字段 | 说明 | 示例 |
|------|------------------|------|
| `name` | 语言名称(英文全称) | "Simplified Chinese" |
| `author` | 贡献者的 GitHub 链接 | "https://github.com/your-username" |
| `months` | 完整月份名称,用 `\|` 分隔 | "一月\|二月\|三月..." |
| `short_months` | 简短月份名称,用 `\|` 分隔 | "1月\|2月\|3月..." |
| `weeks` | 完整星期名称,用 `\|` 分隔 | "星期日\|星期一\|星期二..." |
| `short_weeks` | 简短星期名称,用 `\|` 分隔 | "周日\|周一\|周二..." |
| `seasons` | 季节名称,用 `\|` 分隔 | "春季\|夏季\|秋季\|冬季" |
| `constellations` | 星座名称,用 `\|` 分隔 | "白羊座\|金牛座\|双子座..." |
| `year` | 年份格式,支持单复数 | "%d 年" |
| `month` | 月份格式,支持单复数 | "%d 个月" |
| `week` | 周格式,支持单复数 | "%d 周" |
| `day` | 天格式,支持单复数 | "%d 天" |
| `hour` | 小时格式,支持单复数 | "%d 小时" |
| `minute` | 分钟格式,支持单复数 | "%d 分钟" |
| `second` | 秒格式,支持单复数 | "%d 秒" |
| `now` | "现在" 的翻译 | "刚刚" |
| `ago` | "之前" 的翻译 | "%s前" |
| `from_now` | "之后" 的翻译 | "%s后" |
| `before` | "之前" 的翻译 | "%s前" |
| `after` | "之后" 的翻译 | "%s后" |
#### 单复数说明
1. **东亚语言(中文、日文、韩文等)**:通常只使用一种格式
```json
"year": "%d 年",
"month": "%d 个月"
```
2. **印欧语言(英文、法文、德文等)**:需要区分单复数
```json
"year": "1 year|%d years",
"month": "1 month|%d months"
```
3. **斯拉夫语言(俄文、乌克兰文等)**:可能有更复杂的复数规则
```json
"year": "1 год|2 года|3 года|4 года|%d лет"
```
### 三、提交 Pull Request
1. **创建分支**
```bash
git checkout -b add-xx-language-support
```
2. **提交更改**
```bash
git add lang/xx.json
git commit -m "add XX language support #39"
```
3. **推送并创建 Pull Request**
```bash
git push origin add-xx-language-support
```
4. **Pull Request 标题格式**
```
Add XX Language Support #39
```
### 四、测试验证
提交前请确保:
1. **JSON 格式正确**:使用 `JSON` 验证工具检查语法
2. **字段完整**:确保包含所有必需的 `20` 个字段
3. **分隔符正确**:使用 `|` 作为数组分隔符
4. **占位符正确**:使用 `%d` 作为数字占位符,`%s` 作为字符串占位符
5. **保持一致性**:确保翻译风格与现有语言文件保持一致
6. **文化适应性**:考虑目标语言的文化背景和表达习惯
感谢您为 Carbon 项目贡献新的语言支持!

View File

@@ -1,120 +0,0 @@
# Carbon Localized Language Contribution Guide
## How to Add New Localized Language Support to Carbon
### Step 1: Copy Language Template File
```bash
# Copy from lang/en.json as template
cp lang/en.json lang/xx.json
```
Where `xx` is the `ISO 639-1` language code for the language you want to add (e.g., `zh-CN`, `ja`, `ko`, etc.)
### Step 2: Update Template File Content
Edit the newly created `lang/xx.json` file and translate all English content to the target language. Here is a complete example of a `English` language file:
```json
{
"name": "English",
"author": "https://github.com/gouguoyin",
"months": "January|February|March|April|May|June|July|August|September|October|November|December",
"short_months": "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec",
"weeks": "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday",
"short_weeks": "Sun|Mon|Tue|Wed|Thu|Fri|Sat",
"seasons": "Spring|Summer|Autumn|Winter",
"constellations": "Aries|Taurus|Gemini|Cancer|Leo|Virgo|Libra|Scorpio|Sagittarius|Capricorn|Aquarius|Pisces",
"year": "1 year|%d years",
"month": "1 month|%d months",
"week": "1 week|%d weeks",
"day": "1 day|%d days",
"hour": "1 hour|%d hours",
"minute": "1 minute|%d minutes",
"second": "1 second|%d seconds",
"now": "just now",
"ago": "%s ago",
"from_now": "%s from now",
"before": "%s before",
"after": "%s after"
}
```
#### Field Description
| Field | Description | Example |
|-------|-------------|---------|
| `name` | Language name (English full name) | "English" |
| `author` | Contributor's GitHub link | "https://github.com/gouguoyin" |
| `months` | Full month names, separated by `\|` | "January\|February\|March..." |
| `short_months` | Short month names, separated by `\|` | "Jan\|Feb\|Mar..." |
| `weeks` | Full week names, separated by `\|` | "Sunday\|Monday\|Tuesday..." |
| `short_weeks` | Short week names, separated by `\|` | "Sun\|Mon\|Tue..." |
| `seasons` | Season names, separated by `\|` | "Spring\|Summer\|Autumn\|Winter" |
| `constellations` | Constellation names, separated by `\|` | "Aries\|Taurus\|Gemini..." |
| `year` | Year format, supports singular/plural | "1 year\|%d years" |
| `month` | Month format, supports singular/plural | "1 month\|%d months" |
| `week` | Week format, supports singular/plural | "1 week\|%d weeks" |
| `day` | Day format, supports singular/plural | "1 day\|%d days" |
| `hour` | Hour format, supports singular/plural | "1 hour\|%d hours" |
| `minute` | Minute format, supports singular/plural | "1 minute\|%d minutes" |
| `second` | Second format, supports singular/plural | "1 second\|%d seconds" |
| `now` | Translation of "now" | "just now" |
| `ago` | Translation of "ago" | "%s ago" |
| `from_now` | Translation of "from now" | "%s from now" |
| `before` | Translation of "before" | "%s before" |
| `after` | Translation of "after" | "%s after" |
#### Singular/Plural Handling
1. **East Asian languages (Chinese, Japanese, Korean, etc.)**: Usually use only one format
```json
"year": "%d 年",
"month": "%d 个月"
```
2. **Indo-European languages (English, French, German, etc.)**: Need to distinguish singular/plural
```json
"year": "1 year|%d years",
"month": "1 month|%d months"
```
3. **Slavic languages (Russian, Ukrainian, etc.)**: May have more complex plural rules
```json
"year": "1 год|2 года|3 года|4 года|%d лет"
```
### Step 3: Submit Pull Request
1. **Create Branch**
```bash
git checkout -b add-xx-language-support
```
2. **Commit Changes**
```bash
git add lang/xx.json
git commit -m "add XX language support #39"
```
3. **Push and Create Pull Request**
```bash
git push origin add-xx-language-support
```
4. **Pull Request Title Format**
```
Add XX Language Support #39
```
### Step 4: Test Verification
Before submitting, please ensure:
1. **Correct JSON format**: Use `JSON` validation tools to check syntax
2. **Complete fields**: Ensure all required `20` fields are included
3. **Correct separators**: Use `|` as array separator
4. **Correct placeholders**: Use `%d` as number placeholder, `%s` as string placeholder
5. **Maintain consistency**: Ensure translation style is consistent with existing language files
6. **Cultural adaptation**: Consider the cultural background and expression habits of the target language
Thank you for contributing new language support to the Carbon project!

View File

@@ -1,120 +0,0 @@
# Carbon ローカライズ言語貢献ガイド
## Carbon に新しいローカライズ言語サポートを追加する方法
### 一、言語テンプレートファイルのコピー
```bash
# lang/en.json をテンプレートとしてコピー
cp lang/en.json lang/xx.json
```
`xx` は追加したい言語の `ISO 639-1` 言語コードです(例:`zh-CN`、`ja`、`ko` など)
### 二、テンプレートファイルの内容更新
新しく作成した `lang/xx.json` ファイルを編集し、すべての英語コンテンツを対象言語に翻訳します。以下は `日本語` 言語ファイルの完全な例です:
```json
{
"name": "Japanese",
"author": "https://github.com/your-username",
"months": "1月|2月|3月|4月|5月|6月|7月|8月|9月|10月|11月|12月",
"short_months": "1月|2月|3月|4月|5月|6月|7月|8月|9月|10月|11月|12月",
"weeks": "日曜日|月曜日|火曜日|水曜日|木曜日|金曜日|土曜日",
"short_weeks": "日|月|火|水|木|金|土",
"seasons": "春|夏|秋|冬",
"constellations": "おひつじ座|おうし座|ふたご座|かに座|しし座|おとめ座|てんびん座|さそり座|いて座|やぎ座|みずがめ座|うお座",
"year": "%d 年",
"month": "%d ヶ月",
"week": "%d 週間",
"day": "%d 日",
"hour": "%d 時間",
"minute": "%d 分",
"second": "%d 秒",
"now": "現在",
"ago": "%s前",
"from_now": "%s後",
"before": "%s前",
"after": "%s後"
}
```
#### フィールド説明
| フィールド | 説明 | 例 |
|-----------|------|-----|
| `name` | 言語名(英語の正式名称) | "Japanese" |
| `author` | 貢献者のGitHubリンク | "https://github.com/your-username" |
| `months` | 完全な月名、`\|` で区切る | "1月\|2月\|3月..." |
| `short_months` | 短縮月名、`\|` で区切る | "1月\|2月\|3月..." |
| `weeks` | 完全な曜日名、`\|` で区切る | "日曜日\|月曜日\|火曜日..." |
| `short_weeks` | 短縮曜日名、`\|` で区切る | "日\|月\|火..." |
| `seasons` | 季節名、`\|` で区切る | "春\|夏\|秋\|冬" |
| `constellations` | 星座名、`\|` で区切る | "おひつじ座\|おうし座\|ふたご座..." |
| `year` | 年フォーマット、単数/複数をサポート | "%d 年" |
| `month` | 月フォーマット、単数/複数をサポート | "%d ヶ月" |
| `week` | 週フォーマット、単数/複数をサポート | "%d 週間" |
| `day` | 日フォーマット、単数/複数をサポート | "%d 日" |
| `hour` | 時間フォーマット、単数/複数をサポート | "%d 時間" |
| `minute` | 分フォーマット、単数/複数をサポート | "%d 分" |
| `second` | 秒フォーマット、単数/複数をサポート | "%d 秒" |
| `now` | "現在" の翻訳 | "現在" |
| `ago` | "前" の翻訳 | "%s前" |
| `from_now` | "後" の翻訳 | "%s後" |
| `before` | "前" の翻訳 | "%s前" |
| `after` | "後" の翻訳 | "%s後" |
#### 単数/複数処理
1. **東アジア言語(中国語、日本語、韓国語など)**通常1つのフォーマットのみを使用
```json
"year": "%d 年",
"month": "%d ヶ月"
```
2. **インド・ヨーロッパ語族(英語、フランス語、ドイツ語など)**:単数/複数を区別する必要がある
```json
"year": "1 year|%d years",
"month": "1 month|%d months"
```
3. **スラブ語族(ロシア語、ウクライナ語など)**:より複雑な複数規則がある場合がある
```json
"year": "1 год|2 года|3 года|4 года|%d лет"
```
### 三、Pull Request の提出
1. **ブランチの作成**
```bash
git checkout -b add-xx-language-support
```
2. **変更のコミット**
```bash
git add lang/xx.json
git commit -m "add XX language support #39"
```
3. **プッシュとPull Requestの作成**
```bash
git push origin add-xx-language-support
```
4. **Pull Request タイトル形式**
```
Add XX Language Support #39
```
### 四、テスト検証
提出前に以下を確認してください:
1. **正しいJSON形式**`JSON` 検証ツールを使用して構文をチェック
2. **完全なフィールド**:必要な `20` 個のフィールドすべてが含まれていることを確認
3. **正しい区切り文字**:配列区切り文字として `|` を使用
4. **正しいプレースホルダー**:数字プレースホルダーとして `%d`、文字列プレースホルダーとして `%s` を使用
5. **一貫性の維持**:翻訳スタイルが既存の言語ファイルと一貫していることを確認
6. **文化的適応**:対象言語の文化的背景と表現習慣を考慮
Carbonプロジェクトへの新しい言語サポートの貢献をありがとうございます

View File

@@ -1,120 +0,0 @@
# Carbon 로컬라이즈드 언어 기여 가이드
## Carbon에 새로운 로컬라이즈드 언어 지원을 추가하는 방법
### 一、언어 템플릿 파일 복사
```bash
# lang/en.json을 템플릿으로 복사
cp lang/en.json lang/xx.json
```
`xx`는 추가하려는 언어의 `ISO 639-1` 언어 코드입니다 (예: `zh-CN`, `ja`, `ko` 등)
### 二、템플릿 파일 내용 업데이트
새로 생성한 `lang/xx.json` 파일을 편집하여 모든 영어 내용을 대상 언어로 번역합니다. 다음은 `한국어` 언어 파일의 완전한 예시입니다:
```json
{
"name": "Korean",
"author": "https://github.com/your-username",
"months": "일월|이월|삼월|사월|오월|유월|칠월|팔월|구월|시월|십일월|십이월",
"short_months": "1월|2월|3월|4월|5월|6월|7월|8월|9월|10월|11월|12월",
"weeks": "일요일|월요일|화요일|수요일|목요일|금요일|토요일",
"short_weeks": "일|월|화|수|목|금|토",
"seasons": "봄|여름|가을|겨울",
"constellations": "양자리|황소자리|쌍둥이자리|게자리|사자자리|처녀자리|천칭자리|전갈자리|사수자리|염소자리|물병자리|물고기자리",
"year": "%d 년",
"month": "%d 개월",
"week": "%d 주",
"day": "%d 일",
"hour": "%d 시간",
"minute": "%d 분",
"second": "%d 초",
"now": "방금",
"ago": "%s 전",
"from_now": "%s 후",
"before": "%s 전",
"after": "%s 후"
}
```
#### 필드 설명
| 필드 | 설명 | 예시 |
|------|------|------|
| `name` | 언어 이름 (영어 공식 명칭) | "Korean" |
| `author` | 기여자의 GitHub 링크 | "https://github.com/your-username" |
| `months` | 전체 월 이름, `\|`로 구분 | "일월\|이월\|삼월..." |
| `short_months` | 짧은 월 이름, `\|`로 구분 | "1월\|2월\|3월..." |
| `weeks` | 전체 요일 이름, `\|`로 구분 | "일요일\|월요일\|화요일..." |
| `short_weeks` | 짧은 요일 이름, `\|`로 구분 | "일\|월\|화..." |
| `seasons` | 계절 이름, `\|`로 구분 | "봄\|여름\|가을\|겨울" |
| `constellations` | 별자리 이름, `\|`로 구분 | "양자리\|황소자리\|쌍둥이자리..." |
| `year` | 연도 형식, 단수/복수 지원 | "%d 년" |
| `month` | 월 형식, 단수/복수 지원 | "%d 개월" |
| `week` | 주 형식, 단수/복수 지원 | "%d 주" |
| `day` | 일 형식, 단수/복수 지원 | "%d 일" |
| `hour` | 시간 형식, 단수/복수 지원 | "%d 시간" |
| `minute` | 분 형식, 단수/복수 지원 | "%d 분" |
| `second` | 초 형식, 단수/복수 지원 | "%d 초" |
| `now` | "지금"의 번역 | "방금" |
| `ago` | "전"의 번역 | "%s 전" |
| `from_now` | "후"의 번역 | "%s 후" |
| `before` | "전"의 번역 | "%s 전" |
| `after` | "후"의 번역 | "%s 후" |
#### 단수/복수 처리
1. **동아시아 언어 (중국어, 일본어, 한국어 등)**: 보통 하나의 형식만 사용
```json
"year": "%d 년",
"month": "%d 개월"
```
2. **인도유럽어족 (영어, 프랑스어, 독일어 등)**: 단수/복수를 구분해야 함
```json
"year": "1 year|%d years",
"month": "1 month|%d months"
```
3. **슬라브어족 (러시아어, 우크라이나어 등)**: 더 복잡한 복수 규칙이 있을 수 있음
```json
"year": "1 год|2 года|3 года|4 года|%d лет"
```
### 三、Pull Request 제출
1. **브랜치 생성**
```bash
git checkout -b add-xx-language-support
```
2. **변경사항 커밋**
```bash
git add lang/xx.json
git commit -m "add XX language support #39"
```
3. **푸시 및 Pull Request 생성**
```bash
git push origin add-xx-language-support
```
4. **Pull Request 제목 형식**
```
Add XX Language Support #39
```
### 四、테스트 검증
제출하기 전에 다음을 확인하세요:
1. **올바른 JSON 형식**: `JSON` 검증 도구를 사용하여 구문 확인
2. **완전한 필드**: 필요한 `20` 개의 필드가 모두 포함되어 있는지 확인
3. **올바른 구분자**: 배열 구분자로 `|` 사용
4. **올바른 플레이스홀더**: 숫자 플레이스홀더로 `%d`, 문자열 플레이스홀더로 `%s` 사용
5. **일관성 유지**: 번역 스타일이 기존 언어 파일과 일관성을 유지하는지 확인
6. **문화적 적응**: 대상 언어의 문화적 배경과 표현 습관을 고려
Carbon 프로젝트에 새로운 언어 지원을 기여해 주셔서 감사합니다!