-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add Chinese Translation. #45
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module PTTChinese | ||
|
||
using Markdown | ||
|
||
using ..PlutoTeachingTools | ||
|
||
abstract type Chinese <: AbstractLanguage end | ||
struct zh-CN <: Chinese end | ||
|
||
# computational_thinking.jl | ||
PlutoTeachingTools.hint_str(lang::Lang) where {Lang <: Chinese} = "提示" | ||
PlutoTeachingTools.tip_str(lang::Lang) where {Lang <: Chinese} = "提醒" | ||
PlutoTeachingTools.protip_invite_str(lang::Lang) where {Lang <: Chinese} = "想了解更多?" | ||
PlutoTeachingTools.protip_boxlabel_str(lang::Lang) where {Lang <: Chinese} = "重要提醒" | ||
PlutoTeachingTools.answer_invite_str(lang::Lang) where {Lang <: Chinese} = "想要看答案?" | ||
PlutoTeachingTools.answer_boxlabel_str(lang::Lang) where {Lang <: Chinese} = "答案" | ||
PlutoTeachingTools.almost_str(lang::Lang) where {Lang <: Chinese} = "差不多了!" | ||
PlutoTeachingTools.warning_box_str(lang::Lang) where {Lang <: Chinese} = "警告:" | ||
PlutoTeachingTools.question_box_str(lang::Lang) where {Lang <: Chinese} = "问题:" | ||
PlutoTeachingTools.danger_str(lang::Lang) where {Lang <: Chinese} = "小心:" | ||
PlutoTeachingTools.keyconcept_str(lang::Lang) where {Lang <: Chinese} = "🎯 核心概念" | ||
PlutoTeachingTools.still_missing_str(lang::Lang) where {Lang <: Chinese} = "缺少回应" | ||
PlutoTeachingTools.still_missing_text_str(lang::Lang) where {Lang <: Chinese} = md"把`missing`替换为你的答案." | ||
PlutoTeachingTools.still_nothing_str(lang::Lang) where {Lang <: Chinese} = "我们开始吧!" | ||
PlutoTeachingTools.still_nothing_text_str(lang::Lang) where {Lang <: Chinese} = md"把 `nothing` 替换为你的答案." | ||
PlutoTeachingTools.wrong_type_str(lang::Lang) where {Lang <: Chinese} = "类型错误Type Error" | ||
PlutoTeachingTools.wrong_type_text_str(lang::Lang) where {Lang <: Chinese} = md"检查你的答案的类型." | ||
PlutoTeachingTools.wrong_type_text_str(lang::Lang, var, type) where {Lang <: Chinese} = md"$var 的类型应该是 $type" | ||
PlutoTeachingTools.func_not_defined_str(lang::Lang) where {Lang <: Chinese} = "糟糕!" | ||
PlutoTeachingTools.func_not_defined_text_str(func_name, lang::Lang) where {Lang <: Chinese} = md"请确定你定义了一个名为 **$(Markdown.Code(string(func_name)))** 的函数。" | ||
PlutoTeachingTools.var_not_defined_str(lang::Lang) where {Lang <: Chinese} = "糟糕!" | ||
PlutoTeachingTools.var_not_defined_text_str(variable_name, lang::Lang) where {Lang <: Chinese} = md"请确定你定义了一个名为 **$(Markdown.Code(string(variable_name)))** 的变量。" | ||
PlutoTeachingTools.keep_working_str(lang::Lang) where {Lang <: Chinese} = "继续加油!" | ||
PlutoTeachingTools.keep_working_text_str(lang::Lang) where {Lang <: Chinese} = md"答案还不太对." | ||
PlutoTeachingTools.keep_working_update_str(var, lang::Lang) where {Lang <: Chinese} = md"确保更新代码设置 $var." | ||
PlutoTeachingTools.yays(lang::Lang) where {Lang <: Chinese} = [md"Great!", md"Yay ❤", md"Great! 🎉", md"Well done!", md"Keep it up!", md"Good job!", md"Awesome!", md"You got the right answer!", md"Let's move on to the next part."] | ||
PlutoTeachingTools.correct_str(lang::Lang) where {Lang <: Chinese} = "Got it!" | ||
PlutoTeachingTools.todo_str(lang::Lang) where {Lang <: Chinese} = "TODO" | ||
|
||
PlutoTeachingTools.check_type_isa_missing_text_str(sym, lang::Lang) where {Lang <: Chinese} = md"变量 $sym 仍然被置为 missing." | ||
PlutoTeachingTools.check_type_isa_wrong_type_text_str(sym, lang::Lang) where {Lang <: Chinese} = "$sym 的类型不对. 它应该是 <: " | ||
PlutoTeachingTools.check_type_isa_wrong_type_one_of_text_str(lang::Lang) where {Lang <: Chinese} = "一个" | ||
PlutoTeachingTools.check_type_isa_wrong_type_or_text_str(lang::Lang) where {Lang <: Chinese} = "或者" | ||
PlutoTeachingTools.check_type_isa_not_missing_text_str(sym, lang::Lang) where {Lang <: Chinese} = md"$sym 类型正确." | ||
PlutoTeachingTools.check_type_isa_type_error_str(sym, lang::Lang) where {Lang <: Chinese} = "类型错误Type Error" | ||
|
||
PlutoTeachingTools.check_type_eq_missing_text_str(sym, lang::Lang) where {Lang <: Chinese} = md"变量 $sym 仍然是 missing." | ||
PlutoTeachingTools.check_type_eq_wrong_type_single_text_str(sym, type, lang::Lang) where {Lang <: Chinese} = "$sym 的类型应该是 $type." | ||
PlutoTeachingTools.check_type_eq_wrong_type_multi_text_str(sym, lang::Lang) where {Lang <: Chinese} = "$sym 的类型应该是其中一个 " | ||
PlutoTeachingTools.check_type_eq_type_error_str(lang::Lang) where {Lang <: Chinese} = "类型错误Type Error" | ||
PlutoTeachingTools.check_type_eq_correct_str(sym, lang::Lang) where {Lang <: Chinese} = md"$sym 类型正确." | ||
|
||
# other.jl | ||
PlutoTeachingTools.full_width_mode_str(lang::Lang) where {Lang <: Chinese} = "全屏模式" | ||
|
||
# present.jl | ||
PlutoTeachingTools.present_str(lang::Lang) where {Lang <: Chinese} = "演示" | ||
PlutoTeachingTools.present_mode_str(lang::Lang) where {Lang <: Chinese} = "演示模式" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -59,6 +59,15 @@ include("german.jl") | |||||||||||
import .PTTGerman: GermanGermany, GermanGermanyFormal, GermanGermanyColloquial | ||||||||||||
include("spanish.jl") | ||||||||||||
import .PTTSpanish: SpanishES, SpanishFormal, SpanishColloquial | ||||||||||||
include("chinese.jl") | ||||||||||||
import .PTTChinese: SimplifiedChinese | ||||||||||||
|
||||||||||||
|
||||||||||||
abstract type German <: AbstractLanguage end | ||||||||||||
struct GermanGermanyFormal <: German end | ||||||||||||
struct GermanGermanyColloquial <: German end | ||||||||||||
GermanGermany = GermanGermanyFormal | ||||||||||||
|
||||||||||||
Comment on lines
+65
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be removed. They are imported in L59 and unrelated to the Chinese translation.
Suggested change
|
||||||||||||
|
||||||||||||
const languages_registered = Ref{Dict{String,AbstractLanguage}}( | ||||||||||||
Dict( "en" => PTTEnglish.EnglishUS(), | ||||||||||||
|
@@ -71,14 +80,17 @@ const languages_registered = Ref{Dict{String,AbstractLanguage}}( | |||||||||||
"es_colloq" => PTTSpanish.SpanishColloquial(), | ||||||||||||
"es_es" => PTTSpanish.SpanishES(), | ||||||||||||
"es_es_colloq" => PTTSpanish.SpanishColloquial(), | ||||||||||||
"zh" => PTTChinese.SimplifiedChinese(), | ||||||||||||
"zh_CN" => PTTChinese.SimplifiedChinese(), | ||||||||||||
)) | ||||||||||||
|
||||||||||||
const language_codes_registered = Ref{Dict{AbstractLanguage,Vector{String}}}( | ||||||||||||
Dict( PTTEnglish.EnglishUS() => ["en","en_us"], | ||||||||||||
PTTGerman.GermanGermany() => ["de","de_de"], | ||||||||||||
PTTGerman.GermanGermanyColloquial() => ["de_colloq", "de_de_colloq"], | ||||||||||||
PTTSpanish.SpanishES() => ["es", "es_es"], | ||||||||||||
PTTSpanish.SpanishColloquial() => ["es_colloq", "es_es_colloq"] | ||||||||||||
PTTSpanish.SpanishColloquial() => ["es_colloq", "es_es_colloq"], | ||||||||||||
PTTChinese.SimplifiedChinese() => ["zh", "zh_CN"] | ||||||||||||
)) | ||||||||||||
|
||||||||||||
# Allow users to register additional languages | ||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looks like these are still missing translations.