sqlite_graphrag/i18n/validation/
messages_c.rs1use crate::i18n::{current, Language};
4
5
6pub fn name_required_positional_or_flag() -> String {
8 match current() {
9 Language::English => {
10 "name required: pass as positional argument or via --name".to_string()
11 }
12 Language::Portuguese => {
13 "nome obrigatório: passe como argumento posicional ou via --name".to_string()
14 }
15 }
16}
17
18pub fn api_key_cannot_be_empty() -> String {
20 match current() {
21 Language::English => "API key cannot be empty".to_string(),
22 Language::Portuguese => "chave de API não pode ser vazia".to_string(),
23 }
24}
25
26pub fn from_type_required_batch() -> String {
28 match current() {
29 Language::English => "--from-type is required in batch mode".to_string(),
30 Language::Portuguese => "--from-type é obrigatório no modo batch".to_string(),
31 }
32}
33
34pub fn to_type_required_batch() -> String {
36 match current() {
37 Language::English => "--to-type is required in batch mode".to_string(),
38 Language::Portuguese => "--to-type é obrigatório no modo batch".to_string(),
39 }
40}
41
42pub fn name_required_single_mode() -> String {
44 match current() {
45 Language::English => "--name is required in single mode".to_string(),
46 Language::Portuguese => "--name é obrigatório no modo single".to_string(),
47 }
48}
49
50pub fn target_required_single_mode() -> String {
52 match current() {
53 Language::English => "--target is required in single mode".to_string(),
54 Language::Portuguese => "--target é obrigatório no modo single".to_string(),
55 }
56}
57
58pub fn entity_required_when_memory() -> String {
60 match current() {
61 Language::English => "--entity is required when --memory is used".to_string(),
62 Language::Portuguese => "--entity é obrigatório quando --memory é usado".to_string(),
63 }
64}
65
66pub fn from_required_without_entity_all() -> String {
68 match current() {
69 Language::English => "--from is required when --entity/--all is not used".to_string(),
70 Language::Portuguese => {
71 "--from é obrigatório quando --entity/--all não é usado".to_string()
72 }
73 }
74}
75
76pub fn to_required_without_entity_all() -> String {
78 match current() {
79 Language::English => "--to is required when --entity/--all is not used".to_string(),
80 Language::Portuguese => {
81 "--to é obrigatório quando --entity/--all não é usado".to_string()
82 }
83 }
84}
85
86pub fn name_must_not_be_empty() -> String {
88 match current() {
89 Language::English => "name must not be empty".to_string(),
90 Language::Portuguese => "nome não pode ser vazio".to_string(),
91 }
92}
93
94pub fn source_target_names_identical() -> String {
96 match current() {
97 Language::English => "source and target names are identical".to_string(),
98 Language::Portuguese => "nomes de origem e destino são idênticos".to_string(),
99 }
100}
101
102pub fn source_target_entity_names_identical() -> String {
104 match current() {
105 Language::English => "source and target entity names are identical".to_string(),
106 Language::Portuguese => "nomes de entidade de origem e destino são idênticos".to_string(),
107 }
108}
109
110pub fn empty_version_string() -> String {
112 match current() {
113 Language::English => "empty version string".to_string(),
114 Language::Portuguese => "string de versão vazia".to_string(),
115 }
116}
117
118pub fn failed_to_open_codex_stdin() -> String {
120 match current() {
121 Language::English => "failed to open codex stdin".to_string(),
122 Language::Portuguese => "falha ao abrir stdin do codex".to_string(),
123 }
124}
125
126pub fn failed_to_open_claude_stdin() -> String {
128 match current() {
129 Language::English => "failed to open claude stdin".to_string(),
130 Language::Portuguese => "falha ao abrir stdin do claude".to_string(),
131 }
132}
133
134pub fn stdin_thread_panicked() -> String {
136 match current() {
137 Language::English => "stdin thread panicked".to_string(),
138 Language::Portuguese => "thread de stdin entrou em pânico".to_string(),
139 }
140}
141
142pub fn codex_version_not_utf8() -> String {
144 match current() {
145 Language::English => "codex --version output is not UTF-8".to_string(),
146 Language::Portuguese => "saída de codex --version não é UTF-8".to_string(),
147 }
148}
149
150pub fn claude_version_not_utf8() -> String {
152 match current() {
153 Language::English => "claude --version output is not UTF-8".to_string(),
154 Language::Portuguese => "saída de claude --version não é UTF-8".to_string(),
155 }
156}
157
158pub fn codex_exec_stdout_not_utf8() -> String {
160 match current() {
161 Language::English => "codex exec stdout is not valid UTF-8".to_string(),
162 Language::Portuguese => "stdout de codex exec não é UTF-8 válido".to_string(),
163 }
164}
165
166pub fn codex_stdout_not_utf8() -> String {
168 match current() {
169 Language::English => "codex stdout is not valid UTF-8".to_string(),
170 Language::Portuguese => "stdout do codex não é UTF-8 válido".to_string(),
171 }
172}
173
174pub fn claude_p_stdout_not_utf8() -> String {
176 match current() {
177 Language::English => "claude -p stdout is not valid UTF-8".to_string(),
178 Language::Portuguese => "stdout de claude -p não é UTF-8 válido".to_string(),
179 }
180}
181
182pub fn opencode_stdout_not_utf8() -> String {
184 match current() {
185 Language::English => "opencode stdout is not valid UTF-8".to_string(),
186 Language::Portuguese => "stdout do opencode não é UTF-8 válido".to_string(),
187 }
188}
189
190pub fn codex_no_agent_message() -> String {
192 match current() {
193 Language::English => "codex output contained no agent_message item".to_string(),
194 Language::Portuguese => "saída do codex não continha item agent_message".to_string(),
195 }
196}
197
198pub fn codex_agent_message_not_json_object() -> String {
200 match current() {
201 Language::English => "codex agent_message is not a JSON object".to_string(),
202 Language::Portuguese => "agent_message do codex não é um objeto JSON".to_string(),
203 }
204}
205
206pub fn claude_output_missing_result() -> String {
208 match current() {
209 Language::English => "claude output missing 'result' element".to_string(),
210 Language::Portuguese => "saída do claude sem elemento 'result'".to_string(),
211 }
212}
213
214pub fn llm_missing_description_field() -> String {
216 match current() {
217 Language::English => "LLM result missing 'description' field".to_string(),
218 Language::Portuguese => "resultado LLM sem campo 'description'".to_string(),
219 }
220}
221
222pub fn llm_missing_enriched_body_field() -> String {
224 match current() {
225 Language::English => "LLM result missing 'enriched_body' field".to_string(),
226 Language::Portuguese => "resultado LLM sem campo 'enriched_body'".to_string(),
227 }
228}
229
230pub fn llm_missing_calibrated_weight() -> String {
232 match current() {
233 Language::English => "LLM result missing 'calibrated_weight'".to_string(),
234 Language::Portuguese => "resultado LLM sem 'calibrated_weight'".to_string(),
235 }
236}
237
238pub fn llm_missing_relation() -> String {
240 match current() {
241 Language::English => "LLM result missing 'relation'".to_string(),
242 Language::Portuguese => "resultado LLM sem 'relation'".to_string(),
243 }
244}
245
246pub fn openrouter_chat_timed_out() -> String {
248 match current() {
249 Language::English => "OpenRouter chat request timed out".to_string(),
250 Language::Portuguese => "requisição de chat OpenRouter expirou (timeout)".to_string(),
251 }
252}
253
254pub fn openrouter_invalid_api_key_401() -> String {
256 match current() {
257 Language::English => "invalid OpenRouter API key (HTTP 401)".to_string(),
258 Language::Portuguese => "chave de API OpenRouter inválida (HTTP 401)".to_string(),
259 }
260}
261
262pub fn openrouter_chat_max_retries() -> String {
264 match current() {
265 Language::English => "max retries exceeded for OpenRouter chat request".to_string(),
266 Language::Portuguese => {
267 "número máximo de tentativas excedido para requisição de chat OpenRouter".to_string()
268 }
269 }
270}
271
272pub fn anthropic_api_key_oauth_required() -> String {
274 match current() {
275 Language::English => "ANTHROPIC_API_KEY is set; v1.0.76 requires OAuth. unset it and use `claude login` instead."
276 .to_string(),
277 Language::Portuguese => "ANTHROPIC_API_KEY está definida; v1.0.76 exige OAuth. remova-a e use `claude login`."
278 .to_string(),
279 }
280}
281
282pub fn openai_api_key_oauth_required() -> String {
284 match current() {
285 Language::English => "OPENAI_API_KEY is set; v1.0.76 requires OAuth. unset it and use `codex login` instead."
286 .to_string(),
287 Language::Portuguese => "OPENAI_API_KEY está definida; v1.0.76 exige OAuth. remova-a e use `codex login`."
288 .to_string(),
289 }
290}