Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4fd56a7

Browse files
committed
Note manually translated programs
1 parent3473b9f commit4fd56a7

File tree

3 files changed

+214
-0
lines changed

3 files changed

+214
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
fromcollectionsimportdefaultdict
2+
3+
importpolib
4+
frompathlibimportPath
5+
6+
fromlittleutilsimportjson_to_file
7+
8+
9+
defmain():
10+
this_dir=Path(__file__).parent
11+
locales=this_dir/"locales"
12+
result=defaultdict(dict)
13+
14+
forlang_dirinlocales.iterdir():
15+
mofile=polib.mofile(str(lang_dir/"LC_MESSAGES/futurecoder.mo"))
16+
forentryinmofile:
17+
ifentry.msgid.endswith(".program"):
18+
result[entry.msgid][lang_dir.name]=entry.msgstr.splitlines()
19+
20+
json_to_file(result,this_dir/"manual_programs.json",indent=4,sort_keys=True)
21+
22+
23+
main()
0 Bytes
Binary file not shown.

‎translations/manual_programs.json‎

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
{
2+
"pages.GettingElementsAtPosition.steps.index_error.program": {
3+
"en": [
4+
"words[4]"
5+
],
6+
"es": [
7+
"palabras[4]"
8+
]
9+
},
10+
"pages.GettingElementsAtPosition.steps.introducing_len_and_range.program": {
11+
"en": [
12+
"words = ['This', 'is', 'a', 'list']",
13+
"indices = [0, 1, 2, 3]",
14+
"",
15+
"for index in indices:",
16+
" print(index)",
17+
" print(words[index])"
18+
],
19+
"es": [
20+
"palabras = ['Esto', 'es', 'una', 'lista']",
21+
"indices = [0, 1, 2, 3]",
22+
"",
23+
"for indice in indices:",
24+
" print(indice)",
25+
" print(palabras[indice])"
26+
]
27+
},
28+
"pages.GettingElementsAtPosition.steps.introducing_subscripting.program": {
29+
"en": [
30+
"words = ['This', 'is', 'a', 'list']",
31+
"",
32+
"print(words[0])",
33+
"print(words[1])",
34+
"print(words[2])",
35+
"print(words[3])"
36+
],
37+
"es": [
38+
"palabras = ['Esto', 'es', 'una', 'lista']",
39+
"",
40+
"print(palabras[0])",
41+
"print(palabras[1])",
42+
"print(palabras[2])",
43+
"print(palabras[3])"
44+
]
45+
},
46+
"pages.GettingElementsAtPosition.steps.range_len.program": {
47+
"en": [
48+
"words = ['This', 'is', 'a', 'list']",
49+
"indices = range(4)",
50+
"",
51+
"for index in indices:",
52+
" print(index)",
53+
" print(words[index])"
54+
],
55+
"es": [
56+
"palabras = ['Esto', 'es', 'una', 'lista']",
57+
"",
58+
"for posicion in range(len(palabras)):",
59+
" print(posicion)",
60+
" print(palabras[posicion])"
61+
]
62+
},
63+
"pages.GettingElementsAtPosition.steps.using_len_first_time.program": {
64+
"en": [
65+
"words = ['This', 'is', 'a', 'list']",
66+
"print(len(words))"
67+
],
68+
"es": [
69+
"palabras = ['Esta', 'es', 'una', 'lista']",
70+
"print(len(palabras))"
71+
]
72+
},
73+
"pages.Indentation.steps.mismatched_indentations.program": {
74+
"en": [
75+
"for character in name:",
76+
" print(character)",
77+
" print('---')"
78+
],
79+
"es": [
80+
"for caracter in nombre:",
81+
" print(caracter)",
82+
" print('---')"
83+
]
84+
},
85+
"pages.Indentation.steps.missing_indentation.program": {
86+
"en": [
87+
"for character in name:",
88+
"print(character)"
89+
],
90+
"es": [
91+
"for caracter in nombre:",
92+
"print(caracter)"
93+
]
94+
},
95+
"pages.IntroducingLists.steps.first_list.program": {
96+
"en": [
97+
"words = ['This', 'is', 'a', 'list']",
98+
"",
99+
"for word in words:",
100+
" print(word)"
101+
],
102+
"es": [
103+
"palabras = ['Esta', 'es', 'una', 'lista']",
104+
"",
105+
"for palabra in palabras:",
106+
" print(palabra)"
107+
]
108+
},
109+
"pages.IntroducingNestedLists.steps.first_nested_list_example.program": {
110+
"en": [
111+
"strings = [['hello', 'there'], ['how', 'are', 'you']]",
112+
"print(strings[1][0])"
113+
],
114+
"es": [
115+
"cadenas = [['hola', 'todos'], ['como', 'estas', 'tu']]",
116+
"print(cadenas[1][0])"
117+
]
118+
},
119+
"pages.MultiLineExpressions.steps.invalid_multiline.program": {
120+
"en": [
121+
"is_friend = name ==\"Alice\" or",
122+
" name ==\"Bob\""
123+
],
124+
"es": [
125+
"es_amigo = nombre ==\"Alicia\" or",
126+
" nombre ==\"Bob\""
127+
]
128+
},
129+
"pages.NewlinesAndFormatBoard.steps.invalid_multi_line_string.program": {
130+
"en": [
131+
"assert_equal(",
132+
" format_board([",
133+
" ['X', 'O', 'X'],",
134+
" [' ', 'O', 'O'],",
135+
" [' ', 'X', ' ']",
136+
" ]),",
137+
"\"XOX",
138+
" OO",
139+
" X\"",
140+
")"
141+
],
142+
"es": [
143+
"assert_equal(",
144+
" tablero_formateado([",
145+
" ['X', 'O', 'X'],",
146+
" [' ', 'O', 'O'],",
147+
" [' ', 'X', ' ']",
148+
" ]),",
149+
"\"XOX",
150+
" OO",
151+
" X\"",
152+
")"
153+
]
154+
},
155+
"pages.SingleAndDoubleQuotesInStrings.steps.single_quotes_apostrophe.program": {
156+
"en": [
157+
"print('Alice's Diner')"
158+
],
159+
"es": [
160+
"print('Alice's Diner')"
161+
]
162+
},
163+
"pages.StringMethodsUnderstandingMutation.steps.string_count_index.program": {
164+
"en": [
165+
"string = 'feed the dog and the cat'",
166+
"print(string.count('the'))",
167+
"print(string.index('the'))"
168+
],
169+
"es": [
170+
"string = 'alimentar al perro y al gato'",
171+
"print(string.count('al'))",
172+
"print(string.index('al'))"
173+
]
174+
},
175+
"pages.StringMethodsUnderstandingMutation.steps.string_in_step.program": {
176+
"en": [
177+
"print('the' in 'feed the dog and the cat')"
178+
],
179+
"es": [
180+
"print('al' in 'alimentar al perro y al gato')"
181+
]
182+
},
183+
"pages.TheEqualityOperator.steps.equality_vs_assignment.program": {
184+
"en": [
185+
"print(1 + 2 = 3)"
186+
],
187+
"es": [
188+
"print(1 + 2 = 3)"
189+
]
190+
}
191+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp