forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching·0 forks·Rust·AGPL-3.0·7.1 MiB·490f099·Tahinli·7 hours ago·322 commits
| 1 | //! Strings for the issue, label, milestone and edit-history pages. Sentences that carry values |
| 2 | //! have a helper below the `t` match, which returns a `String`. |
| 3 | |
| 4 | use super::Lang; |
| 5 | |
| 6 | #[allow(dead_code)] |
| 7 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 8 | pub enum K { |
| 9 | // Shared labels and buttons. |
| 10 | CouldNotSave, |
| 11 | GoBack, |
| 12 | Issues, |
| 13 | Labels, |
| 14 | Milestones, |
| 15 | Pinned, |
| 16 | Comment, |
| 17 | Edit, |
| 18 | Delete, |
| 19 | Title, |
| 20 | Description, |
| 21 | Cancel, |
| 22 | Name, |
| 23 | Color, |
| 24 | Reason, |
| 25 | None, |
| 26 | Open, |
| 27 | Closed, |
| 28 | Search, |
| 29 | Sort, |
| 30 | Unknown, |
| 31 | System, |
| 32 | Edited, |
| 33 | EditedBy, |
| 34 | Raw, |
| 35 | |
| 36 | // Pin box and sidebar pin. |
| 37 | IssuePages, |
| 38 | PinIssue, |
| 39 | UnpinIssue, |
| 40 | PinnedTopNote, |
| 41 | PinnedIssues, |
| 42 | |
| 43 | // Lock reasons: the lowercase reader text, then the select options. |
| 44 | LockOffTopic, |
| 45 | LockTooHeated, |
| 46 | LockResolved, |
| 47 | LockSpam, |
| 48 | OptOffTopic, |
| 49 | OptTooHeated, |
| 50 | OptResolved, |
| 51 | OptSpam, |
| 52 | ConversationLocked, |
| 53 | ArchivedIssuesReadOnly, |
| 54 | LogIn, |
| 55 | LogInLink, |
| 56 | ToComment, |
| 57 | |
| 58 | // Timeline events. |
| 59 | ClosedCompleted, |
| 60 | ClosedNotPlanned, |
| 61 | ClosedThis, |
| 62 | ReopenedThis, |
| 63 | ReferencedThis, |
| 64 | LockedConversation, |
| 65 | UnlockedConversation, |
| 66 | PinnedThisIssue, |
| 67 | UnpinnedThisIssue, |
| 68 | MergedCommit, |
| 69 | PushedNewCommits, |
| 70 | DeletedHeadBranch, |
| 71 | InCommit, |
| 72 | ReviewDismissedPrefix, |
| 73 | |
| 74 | // Item byline and edit forms. |
| 75 | StateClosedNotPlanned, |
| 76 | SaveChanges, |
| 77 | EditComment, |
| 78 | SaveComment, |
| 79 | |
| 80 | // Reviews and reactions. |
| 81 | ApprovedChanges, |
| 82 | RequestedChanges, |
| 83 | Reviewed, |
| 84 | ApprovedDismissed, |
| 85 | RequestedDismissed, |
| 86 | ReviewedDismissed, |
| 87 | DismissedPrefix, |
| 88 | AddReaction, |
| 89 | NoDescription, |
| 90 | |
| 91 | // Sidebar boxes. |
| 92 | NoRepoLabels, |
| 93 | SaveLabels, |
| 94 | NoneYet, |
| 95 | Assignees, |
| 96 | SaveAssignees, |
| 97 | AssignToMe, |
| 98 | MilestoneBox, |
| 99 | NoneOption, |
| 100 | SaveMilestone, |
| 101 | ConversationBox, |
| 102 | Locked, |
| 103 | UnlockConversation, |
| 104 | NoReason, |
| 105 | LockConversation, |
| 106 | LockedToCollaborators, |
| 107 | |
| 108 | // Comment form. |
| 109 | AddComment, |
| 110 | CloseCompleted, |
| 111 | CloseNotPlanned, |
| 112 | CommentEmpty, |
| 113 | Add, |
| 114 | Close, |
| 115 | Reopen, |
| 116 | |
| 117 | // Label page. |
| 118 | LabelsArchived, |
| 119 | NoLabelsYet, |
| 120 | AddDefaultLabels, |
| 121 | SaveLabel, |
| 122 | NewLabel, |
| 123 | CreateLabel, |
| 124 | OpenLabelCount, |
| 125 | |
| 126 | // Milestone page. |
| 127 | MilestonesArchived, |
| 128 | Overdue, |
| 129 | MilestoneState, |
| 130 | NoClosedMilestones, |
| 131 | NoOpenMilestones, |
| 132 | NewMilestone, |
| 133 | DueDate, |
| 134 | CreateMilestone, |
| 135 | EditMilestone, |
| 136 | BackToMilestones, |
| 137 | StateLabel, |
| 138 | ClosedMilestoneCount, |
| 139 | OpenMilestoneCount, |
| 140 | |
| 141 | // Issue list and new issue. |
| 142 | OpenIssue, |
| 143 | ClosedIssue, |
| 144 | SortNewest, |
| 145 | SortOldest, |
| 146 | SortUpdated, |
| 147 | NewIssue, |
| 148 | NoIssuesMatch, |
| 149 | NoIssuesYet, |
| 150 | SearchTitles, |
| 151 | FiltersApplied, |
| 152 | ClearFilters, |
| 153 | Opened, |
| 154 | By, |
| 155 | ChooseTemplate, |
| 156 | BlankIssue, |
| 157 | SubmitNewIssue, |
| 158 | Newer, |
| 159 | Older, |
| 160 | |
| 161 | // Edit history. |
| 162 | HistIssueDescription, |
| 163 | HistPullDescription, |
| 164 | HistComment, |
| 165 | HistReviewComment, |
| 166 | NoEarlierVersions, |
| 167 | } |
| 168 | |
| 169 | /// The text after the time in "editor edited 3 days ago". Turkish puts the verb last. |
| 170 | pub fn edited_after(lang: Lang) -> &'static str { |
| 171 | match lang { |
| 172 | Lang::En => "", |
| 173 | Lang::Tr => " düzenledi", |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | pub fn t(lang: Lang, key: K) -> &'static str { |
| 178 | match (key, lang) { |
| 179 | (K::CouldNotSave, Lang::En) => "Could not save", |
| 180 | (K::CouldNotSave, Lang::Tr) => "Kaydedilemedi", |
| 181 | (K::GoBack, Lang::En) => "Go back", |
| 182 | (K::GoBack, Lang::Tr) => "Geri dön", |
| 183 | (K::Issues, Lang::En) => "Issues", |
| 184 | (K::Issues, Lang::Tr) => "Sorunlar", |
| 185 | (K::Labels, Lang::En) => "Labels", |
| 186 | (K::Labels, Lang::Tr) => "Etiketler", |
| 187 | (K::Milestones, Lang::En) => "Milestones", |
| 188 | (K::Milestones, Lang::Tr) => "Kilometre taşları", |
| 189 | (K::Pinned, Lang::En) => "Pinned", |
| 190 | (K::Pinned, Lang::Tr) => "Sabitlenmiş", |
| 191 | (K::Comment, Lang::En) => "Comment", |
| 192 | (K::Comment, Lang::Tr) => "Yorum", |
| 193 | (K::Edit, Lang::En) => "Edit", |
| 194 | (K::Edit, Lang::Tr) => "Düzenle", |
| 195 | (K::Delete, Lang::En) => "Delete", |
| 196 | (K::Delete, Lang::Tr) => "Sil", |
| 197 | (K::Title, Lang::En) => "Title", |
| 198 | (K::Title, Lang::Tr) => "Başlık", |
| 199 | (K::Description, Lang::En) => "Description", |
| 200 | (K::Description, Lang::Tr) => "Açıklama", |
| 201 | (K::Cancel, Lang::En) => "Cancel", |
| 202 | (K::Cancel, Lang::Tr) => "İptal", |
| 203 | (K::Name, Lang::En) => "Name", |
| 204 | (K::Name, Lang::Tr) => "Ad", |
| 205 | (K::Color, Lang::En) => "Color", |
| 206 | (K::Color, Lang::Tr) => "Renk", |
| 207 | (K::Reason, Lang::En) => "Reason", |
| 208 | (K::Reason, Lang::Tr) => "Neden", |
| 209 | (K::None, Lang::En) => "None", |
| 210 | (K::None, Lang::Tr) => "Yok", |
| 211 | (K::Open, Lang::En) => "Open", |
| 212 | (K::Open, Lang::Tr) => "Açık", |
| 213 | (K::Closed, Lang::En) => "Closed", |
| 214 | (K::Closed, Lang::Tr) => "Kapalı", |
| 215 | (K::Search, Lang::En) => "Search", |
| 216 | (K::Search, Lang::Tr) => "Ara", |
| 217 | (K::Sort, Lang::En) => "Sort", |
| 218 | (K::Sort, Lang::Tr) => "Sırala", |
| 219 | (K::Unknown, Lang::En) => "unknown", |
| 220 | (K::Unknown, Lang::Tr) => "bilinmeyen", |
| 221 | (K::System, Lang::En) => "system", |
| 222 | (K::System, Lang::Tr) => "sistem", |
| 223 | (K::Edited, Lang::En) => "edited", |
| 224 | (K::Edited, Lang::Tr) => "düzenlendi", |
| 225 | (K::EditedBy, Lang::En) => " edited ", |
| 226 | (K::EditedBy, Lang::Tr) => " ", |
| 227 | (K::Raw, Lang::En) => "Raw", |
| 228 | (K::Raw, Lang::Tr) => "Ham", |
| 229 | |
| 230 | (K::IssuePages, Lang::En) => "Issue pages", |
| 231 | (K::IssuePages, Lang::Tr) => "Sorun sayfaları", |
| 232 | (K::PinIssue, Lang::En) => "Pin issue", |
| 233 | (K::PinIssue, Lang::Tr) => "Sorunu sabitle", |
| 234 | (K::UnpinIssue, Lang::En) => "Unpin issue", |
| 235 | (K::UnpinIssue, Lang::Tr) => "Sabitlemeyi kaldır", |
| 236 | (K::PinnedTopNote, Lang::En) => "Pinned to the top of the issue list.", |
| 237 | (K::PinnedTopNote, Lang::Tr) => "Sorun listesinin en üstünde sabitlendi.", |
| 238 | (K::PinnedIssues, Lang::En) => "Pinned issues", |
| 239 | (K::PinnedIssues, Lang::Tr) => "Sabitlenmiş sorunlar", |
| 240 | |
| 241 | (K::LockOffTopic, Lang::En) => "off-topic", |
| 242 | (K::LockOffTopic, Lang::Tr) => "konu dışı", |
| 243 | (K::LockTooHeated, Lang::En) => "too heated", |
| 244 | (K::LockTooHeated, Lang::Tr) => "tartışma kızıştı", |
| 245 | (K::LockResolved, Lang::En) => "resolved", |
| 246 | (K::LockResolved, Lang::Tr) => "çözüldü", |
| 247 | (K::LockSpam, Lang::En) => "spam", |
| 248 | (K::LockSpam, Lang::Tr) => "spam", |
| 249 | (K::OptOffTopic, Lang::En) => "Off-topic", |
| 250 | (K::OptOffTopic, Lang::Tr) => "Konu dışı", |
| 251 | (K::OptTooHeated, Lang::En) => "Too heated", |
| 252 | (K::OptTooHeated, Lang::Tr) => "Tartışma kızıştı", |
| 253 | (K::OptResolved, Lang::En) => "Resolved", |
| 254 | (K::OptResolved, Lang::Tr) => "Çözüldü", |
| 255 | (K::OptSpam, Lang::En) => "Spam", |
| 256 | (K::OptSpam, Lang::Tr) => "Spam", |
| 257 | (K::ConversationLocked, Lang::En) => { |
| 258 | "This conversation has been locked and limited to collaborators." |
| 259 | } |
| 260 | (K::ConversationLocked, Lang::Tr) => { |
| 261 | "Bu tartışma kilitlendi ve yalnızca katkıda bulunanlarla sınırlandı." |
| 262 | } |
| 263 | (K::ArchivedIssuesReadOnly, Lang::En) => { |
| 264 | "This repository is archived, so its issues are read-only." |
| 265 | } |
| 266 | (K::ArchivedIssuesReadOnly, Lang::Tr) => { |
| 267 | "Bu depo arşivlenmiş, bu yüzden sorunları salt okunurdur." |
| 268 | } |
| 269 | (K::LogIn, Lang::En) => "Log in", |
| 270 | (K::LogIn, Lang::Tr) => "Giriş yap", |
| 271 | (K::LogInLink, Lang::En) => "Log in", |
| 272 | (K::LogInLink, Lang::Tr) => "giriş yapın", |
| 273 | (K::ToComment, Lang::En) => " to comment.", |
| 274 | (K::ToComment, Lang::Tr) => ".", |
| 275 | |
| 276 | (K::ClosedCompleted, Lang::En) => "closed this as completed", |
| 277 | (K::ClosedCompleted, Lang::Tr) => "bunu tamamlandı olarak kapattı", |
| 278 | (K::ClosedNotPlanned, Lang::En) => "closed this as not planned", |
| 279 | (K::ClosedNotPlanned, Lang::Tr) => "bunu planlanmadı olarak kapattı", |
| 280 | (K::ClosedThis, Lang::En) => "closed this", |
| 281 | (K::ClosedThis, Lang::Tr) => "bunu kapattı", |
| 282 | (K::ReopenedThis, Lang::En) => "reopened this", |
| 283 | (K::ReopenedThis, Lang::Tr) => "bunu yeniden açtı", |
| 284 | (K::ReferencedThis, Lang::En) => "referenced this", |
| 285 | (K::ReferencedThis, Lang::Tr) => "buna atıfta bulundu", |
| 286 | (K::LockedConversation, Lang::En) => "locked this conversation", |
| 287 | (K::LockedConversation, Lang::Tr) => "bu tartışmayı kilitledi", |
| 288 | (K::UnlockedConversation, Lang::En) => "unlocked this conversation", |
| 289 | (K::UnlockedConversation, Lang::Tr) => "bu tartışmanın kilidini açtı", |
| 290 | (K::PinnedThisIssue, Lang::En) => "pinned this issue", |
| 291 | (K::PinnedThisIssue, Lang::Tr) => "bu sorunu sabitledi", |
| 292 | (K::UnpinnedThisIssue, Lang::En) => "unpinned this issue", |
| 293 | (K::UnpinnedThisIssue, Lang::Tr) => "bu sorunun sabitlemesini kaldırdı", |
| 294 | (K::MergedCommit, Lang::En) => "merged commit", |
| 295 | (K::MergedCommit, Lang::Tr) => "commit'i birleştirdi", |
| 296 | (K::PushedNewCommits, Lang::En) => "pushed new commits", |
| 297 | (K::PushedNewCommits, Lang::Tr) => "yeni commit'ler gönderdi", |
| 298 | (K::DeletedHeadBranch, Lang::En) => "deleted the head branch", |
| 299 | (K::DeletedHeadBranch, Lang::Tr) => "kaynak dalını sildi", |
| 300 | (K::InCommit, Lang::En) => " in", |
| 301 | (K::InCommit, Lang::Tr) => "commit'inde", |
| 302 | (K::ReviewDismissedPrefix, Lang::En) => "dismissed a review: ", |
| 303 | (K::ReviewDismissedPrefix, Lang::Tr) => "bir incelemeyi iptal etti: ", |
| 304 | |
| 305 | (K::StateClosedNotPlanned, Lang::En) => "Closed as not planned", |
| 306 | (K::StateClosedNotPlanned, Lang::Tr) => "Planlanmadı olarak kapalı", |
| 307 | (K::SaveChanges, Lang::En) => "Save changes", |
| 308 | (K::SaveChanges, Lang::Tr) => "Değişiklikleri kaydet", |
| 309 | (K::EditComment, Lang::En) => "Edit comment", |
| 310 | (K::EditComment, Lang::Tr) => "Yorumu düzenle", |
| 311 | (K::SaveComment, Lang::En) => "Save comment", |
| 312 | (K::SaveComment, Lang::Tr) => "Yorumu kaydet", |
| 313 | |
| 314 | (K::ApprovedChanges, Lang::En) => "approved these changes", |
| 315 | (K::ApprovedChanges, Lang::Tr) => "bu değişiklikleri onayladı", |
| 316 | (K::RequestedChanges, Lang::En) => "requested changes", |
| 317 | (K::RequestedChanges, Lang::Tr) => "değişiklik istedi", |
| 318 | (K::Reviewed, Lang::En) => "reviewed", |
| 319 | (K::Reviewed, Lang::Tr) => "inceledi", |
| 320 | (K::ApprovedDismissed, Lang::En) => "approved these changes (dismissed)", |
| 321 | (K::ApprovedDismissed, Lang::Tr) => "bu değişiklikleri onayladı (iptal edildi)", |
| 322 | (K::RequestedDismissed, Lang::En) => "requested changes (dismissed)", |
| 323 | (K::RequestedDismissed, Lang::Tr) => "değişiklik istedi (iptal edildi)", |
| 324 | (K::ReviewedDismissed, Lang::En) => "reviewed (dismissed)", |
| 325 | (K::ReviewedDismissed, Lang::Tr) => "inceledi (iptal edildi)", |
| 326 | (K::DismissedPrefix, Lang::En) => "dismissed: ", |
| 327 | (K::DismissedPrefix, Lang::Tr) => "iptal edildi: ", |
| 328 | (K::AddReaction, Lang::En) => "React", |
| 329 | (K::AddReaction, Lang::Tr) => "Tepki ver", |
| 330 | (K::NoDescription, Lang::En) => "_No description provided._", |
| 331 | (K::NoDescription, Lang::Tr) => "_Açıklama girilmedi._", |
| 332 | |
| 333 | (K::NoRepoLabels, Lang::En) => "This repository has no labels yet.", |
| 334 | (K::NoRepoLabels, Lang::Tr) => "Bu depoda henüz etiket yok.", |
| 335 | (K::SaveLabels, Lang::En) => "Save labels", |
| 336 | (K::SaveLabels, Lang::Tr) => "Etiketleri kaydet", |
| 337 | (K::NoneYet, Lang::En) => "None yet.", |
| 338 | (K::NoneYet, Lang::Tr) => "Henüz yok.", |
| 339 | (K::Assignees, Lang::En) => "Assignees", |
| 340 | (K::Assignees, Lang::Tr) => "Atananlar", |
| 341 | (K::SaveAssignees, Lang::En) => "Save assignees", |
| 342 | (K::SaveAssignees, Lang::Tr) => "Atananları kaydet", |
| 343 | (K::AssignToMe, Lang::En) => "Assign to me", |
| 344 | (K::AssignToMe, Lang::Tr) => "Bana ata", |
| 345 | (K::MilestoneBox, Lang::En) => "Milestone", |
| 346 | (K::MilestoneBox, Lang::Tr) => "Kilometre taşı", |
| 347 | (K::NoneOption, Lang::En) => "None", |
| 348 | (K::NoneOption, Lang::Tr) => "Yok", |
| 349 | (K::SaveMilestone, Lang::En) => "Save milestone", |
| 350 | (K::SaveMilestone, Lang::Tr) => "Kilometre taşını kaydet", |
| 351 | (K::ConversationBox, Lang::En) => "Conversation", |
| 352 | (K::ConversationBox, Lang::Tr) => "Tartışma", |
| 353 | (K::Locked, Lang::En) => "Locked", |
| 354 | (K::Locked, Lang::Tr) => "Kilitli", |
| 355 | (K::UnlockConversation, Lang::En) => "Unlock conversation", |
| 356 | (K::UnlockConversation, Lang::Tr) => "Tartışmanın kilidini aç", |
| 357 | (K::NoReason, Lang::En) => "No reason", |
| 358 | (K::NoReason, Lang::Tr) => "Neden yok", |
| 359 | (K::LockConversation, Lang::En) => "Lock conversation", |
| 360 | (K::LockConversation, Lang::Tr) => "Tartışmayı kilitle", |
| 361 | (K::LockedToCollaborators, Lang::En) => "Locked to collaborators", |
| 362 | (K::LockedToCollaborators, Lang::Tr) => "Katkıda bulunanlarla sınırlı", |
| 363 | |
| 364 | (K::AddComment, Lang::En) => "Add a comment", |
| 365 | (K::AddComment, Lang::Tr) => "Yorum ekle", |
| 366 | (K::CloseCompleted, Lang::En) => "Close as completed", |
| 367 | (K::CloseCompleted, Lang::Tr) => "Tamamlandı olarak kapat", |
| 368 | (K::CloseNotPlanned, Lang::En) => "Close as not planned", |
| 369 | (K::CloseNotPlanned, Lang::Tr) => "Planlanmadı olarak kapat", |
| 370 | (K::CommentEmpty, Lang::En) => "Comment cannot be empty.", |
| 371 | (K::CommentEmpty, Lang::Tr) => "Yorum boş olamaz.", |
| 372 | (K::Add, Lang::En) => "Add", |
| 373 | (K::Add, Lang::Tr) => "Ekle", |
| 374 | (K::Close, Lang::En) => "Close", |
| 375 | (K::Close, Lang::Tr) => "Kapat", |
| 376 | (K::Reopen, Lang::En) => "Reopen", |
| 377 | (K::Reopen, Lang::Tr) => "Yeniden aç", |
| 378 | |
| 379 | (K::LabelsArchived, Lang::En) => "This repository is archived. Labels are read-only.", |
| 380 | (K::LabelsArchived, Lang::Tr) => "Bu depo arşivlenmiş. Etiketler salt okunur.", |
| 381 | (K::NoLabelsYet, Lang::En) => "No labels yet.", |
| 382 | (K::NoLabelsYet, Lang::Tr) => "Henüz etiket yok.", |
| 383 | (K::AddDefaultLabels, Lang::En) => "Add default labels", |
| 384 | (K::AddDefaultLabels, Lang::Tr) => "Varsayılan etiketleri ekle", |
| 385 | (K::SaveLabel, Lang::En) => "Save label", |
| 386 | (K::SaveLabel, Lang::Tr) => "Etiketi kaydet", |
| 387 | (K::NewLabel, Lang::En) => "New label", |
| 388 | (K::NewLabel, Lang::Tr) => "Yeni etiket", |
| 389 | (K::CreateLabel, Lang::En) => "Create label", |
| 390 | (K::CreateLabel, Lang::Tr) => "Etiketi oluştur", |
| 391 | (K::OpenLabelCount, Lang::En) => "open", |
| 392 | (K::OpenLabelCount, Lang::Tr) => "açık", |
| 393 | |
| 394 | (K::MilestonesArchived, Lang::En) => { |
| 395 | "This repository is archived. Milestones are read-only." |
| 396 | } |
| 397 | (K::MilestonesArchived, Lang::Tr) => "Bu depo arşivlenmiş. Kilometre taşları salt okunur.", |
| 398 | (K::Overdue, Lang::En) => "overdue", |
| 399 | (K::Overdue, Lang::Tr) => "gecikmiş", |
| 400 | (K::MilestoneState, Lang::En) => "Milestone state", |
| 401 | (K::MilestoneState, Lang::Tr) => "Kilometre taşı durumu", |
| 402 | (K::NoClosedMilestones, Lang::En) => "No closed milestones.", |
| 403 | (K::NoClosedMilestones, Lang::Tr) => "Kapalı kilometre taşı yok.", |
| 404 | (K::NoOpenMilestones, Lang::En) => "No open milestones.", |
| 405 | (K::NoOpenMilestones, Lang::Tr) => "Açık kilometre taşı yok.", |
| 406 | (K::NewMilestone, Lang::En) => "New milestone", |
| 407 | (K::NewMilestone, Lang::Tr) => "Yeni kilometre taşı", |
| 408 | (K::DueDate, Lang::En) => "Due date", |
| 409 | (K::DueDate, Lang::Tr) => "Bitiş tarihi", |
| 410 | (K::CreateMilestone, Lang::En) => "Create milestone", |
| 411 | (K::CreateMilestone, Lang::Tr) => "Kilometre taşı oluştur", |
| 412 | (K::EditMilestone, Lang::En) => "Edit milestone", |
| 413 | (K::EditMilestone, Lang::Tr) => "Kilometre taşını düzenle", |
| 414 | (K::BackToMilestones, Lang::En) => "Back to milestones", |
| 415 | (K::BackToMilestones, Lang::Tr) => "Kilometre taşlarına dön", |
| 416 | (K::StateLabel, Lang::En) => "State", |
| 417 | (K::StateLabel, Lang::Tr) => "Durum", |
| 418 | (K::ClosedMilestoneCount, Lang::En) => "closed", |
| 419 | (K::ClosedMilestoneCount, Lang::Tr) => "kapalı", |
| 420 | (K::OpenMilestoneCount, Lang::En) => "open", |
| 421 | (K::OpenMilestoneCount, Lang::Tr) => "açık", |
| 422 | |
| 423 | (K::OpenIssue, Lang::En) => "Open issue", |
| 424 | (K::OpenIssue, Lang::Tr) => "Açık sorun", |
| 425 | (K::ClosedIssue, Lang::En) => "Closed issue", |
| 426 | (K::ClosedIssue, Lang::Tr) => "Kapalı sorun", |
| 427 | (K::SortNewest, Lang::En) => "Newest", |
| 428 | (K::SortNewest, Lang::Tr) => "En yeni", |
| 429 | (K::SortOldest, Lang::En) => "Oldest", |
| 430 | (K::SortOldest, Lang::Tr) => "En eski", |
| 431 | (K::SortUpdated, Lang::En) => "Recently updated", |
| 432 | (K::SortUpdated, Lang::Tr) => "Son güncellenen", |
| 433 | (K::NewIssue, Lang::En) => "New issue", |
| 434 | (K::NewIssue, Lang::Tr) => "Yeni sorun", |
| 435 | (K::NoIssuesMatch, Lang::En) => "No issues match these filters.", |
| 436 | (K::NoIssuesMatch, Lang::Tr) => "Bu filtrelerle eşleşen sorun yok.", |
| 437 | (K::NoIssuesYet, Lang::En) => "No issues yet. Open one to start a conversation.", |
| 438 | (K::NoIssuesYet, Lang::Tr) => "Henüz sorun yok. Konuşmayı başlatmak için bir sorun açın.", |
| 439 | (K::SearchTitles, Lang::En) => "Search titles", |
| 440 | (K::SearchTitles, Lang::Tr) => "Başlıklarda ara", |
| 441 | (K::FiltersApplied, Lang::En) => "Filters applied · ", |
| 442 | (K::FiltersApplied, Lang::Tr) => "Filtreler uygulandı · ", |
| 443 | (K::ClearFilters, Lang::En) => "Clear filters", |
| 444 | (K::ClearFilters, Lang::Tr) => "Filtreleri temizle", |
| 445 | (K::Opened, Lang::En) => " opened ", |
| 446 | (K::Opened, Lang::Tr) => " açıldı ", |
| 447 | (K::By, Lang::En) => " by ", |
| 448 | (K::By, Lang::Tr) => " tarafından ", |
| 449 | (K::ChooseTemplate, Lang::En) => "Choose a template to start from.", |
| 450 | (K::ChooseTemplate, Lang::Tr) => "Başlamak için bir şablon seçin.", |
| 451 | (K::BlankIssue, Lang::En) => "Open a blank issue", |
| 452 | (K::BlankIssue, Lang::Tr) => "Boş bir sorun aç", |
| 453 | (K::SubmitNewIssue, Lang::En) => "Submit new issue", |
| 454 | (K::SubmitNewIssue, Lang::Tr) => "Yeni sorunu gönder", |
| 455 | (K::Newer, Lang::En) => "Newer", |
| 456 | (K::Newer, Lang::Tr) => "Daha yeni", |
| 457 | (K::Older, Lang::En) => "Older", |
| 458 | (K::Older, Lang::Tr) => "Daha eski", |
| 459 | |
| 460 | (K::HistIssueDescription, Lang::En) => "issue description", |
| 461 | (K::HistIssueDescription, Lang::Tr) => "sorun açıklaması", |
| 462 | (K::HistPullDescription, Lang::En) => "pull request description", |
| 463 | (K::HistPullDescription, Lang::Tr) => "çekme isteği açıklaması", |
| 464 | (K::HistComment, Lang::En) => "comment", |
| 465 | (K::HistComment, Lang::Tr) => "yorum", |
| 466 | (K::HistReviewComment, Lang::En) => "review comment", |
| 467 | (K::HistReviewComment, Lang::Tr) => "inceleme yorumu", |
| 468 | (K::NoEarlierVersions, Lang::En) => "No earlier versions.", |
| 469 | (K::NoEarlierVersions, Lang::Tr) => "Önceki sürüm yok.", |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | /// `1 comment` or `3 comments`. Turkish does not pluralise after a number. |
| 474 | pub fn comment_count(lang: Lang, n: i64) -> String { |
| 475 | match lang { |
| 476 | Lang::En => format!("{n} comment{}", if n == 1 { "" } else { "s" }), |
| 477 | Lang::Tr => format!("{n} yorum"), |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | /// `1 earlier version` or `3 earlier versions`. |
| 482 | pub fn earlier_versions(lang: Lang, n: usize) -> String { |
| 483 | match lang { |
| 484 | Lang::En => format!("{n} earlier version{}", if n == 1 { "" } else { "s" }), |
| 485 | Lang::Tr => format!("{n} önceki sürüm"), |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | /// `{n} open` on a label row. |
| 490 | pub fn open_label_count(lang: Lang, n: i64) -> String { |
| 491 | format!("{n} {}", t(lang, K::OpenLabelCount)) |
| 492 | } |
| 493 | |
| 494 | /// `{n} open` on a milestone progress bar. |
| 495 | pub fn open_milestone_count(lang: Lang, n: i64) -> String { |
| 496 | format!("{n} {}", t(lang, K::OpenMilestoneCount)) |
| 497 | } |
| 498 | |
| 499 | /// `{n} closed` on a milestone progress bar. |
| 500 | pub fn closed_milestone_count(lang: Lang, n: i64) -> String { |
| 501 | format!("{n} {}", t(lang, K::ClosedMilestoneCount)) |
| 502 | } |
| 503 | |
| 504 | /// `Due {date}` on a milestone row. |
| 505 | pub fn due_text(lang: Lang, due: &str) -> String { |
| 506 | match lang { |
| 507 | Lang::En => format!("Due {due}"), |
| 508 | Lang::Tr => format!("Bitiş: {due}"), |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /// The lock notice on a conversation the viewer may not add to, with the reason label. |
| 513 | pub fn conversation_locked_for(lang: Lang, reason: &str) -> String { |
| 514 | match lang { |
| 515 | Lang::En => { |
| 516 | format!("This conversation has been locked ({reason}) and limited to collaborators.") |
| 517 | } |
| 518 | Lang::Tr => format!( |
| 519 | "Bu tartışma kilitlendi ({reason}) ve yalnızca katkıda bulunanlarla sınırlandı." |
| 520 | ), |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /// `Open {n}` on the issue state tabs. |
| 525 | pub fn tab_open(lang: Lang, n: impl std::fmt::Display) -> String { |
| 526 | match lang { |
| 527 | Lang::En => format!("Open {n}"), |
| 528 | Lang::Tr => format!("Açık {n}"), |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | /// `Closed {n}` on the issue state tabs. |
| 533 | pub fn tab_closed(lang: Lang, n: impl std::fmt::Display) -> String { |
| 534 | match lang { |
| 535 | Lang::En => format!("Closed {n}"), |
| 536 | Lang::Tr => format!("Kapalı {n}"), |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | /// `All {n}` on the issue state tabs. |
| 541 | pub fn tab_all(lang: Lang, n: impl std::fmt::Display) -> String { |
| 542 | match lang { |
| 543 | Lang::En => format!("All {n}"), |
| 544 | Lang::Tr => format!("Tümü {n}"), |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | /// `Page {n}` under the issue list. |
| 549 | pub fn page_label(lang: Lang, n: u32) -> String { |
| 550 | match lang { |
| 551 | Lang::En => format!("Page {n}"), |
| 552 | Lang::Tr => format!("Sayfa {n}"), |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | /// `Back to #{n}` on the edit history page. |
| 557 | pub fn back_to_item(lang: Lang, number: i64) -> String { |
| 558 | match lang { |
| 559 | Lang::En => format!("Back to #{number}"), |
| 560 | Lang::Tr => format!("#{number} numaraya dön"), |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | /// `Edit issue #{n}` or `Edit pull request #{n}`. |
| 565 | pub fn edit_heading(lang: Lang, pull: bool, number: i64) -> String { |
| 566 | match (lang, pull) { |
| 567 | (Lang::En, false) => format!("Edit issue #{number}"), |
| 568 | (Lang::En, true) => format!("Edit pull request #{number}"), |
| 569 | (Lang::Tr, false) => format!("Sorunu düzenle #{number}"), |
| 570 | (Lang::Tr, true) => format!("Çekme isteğini düzenle #{number}"), |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | /// The title of the item edit page: `Edit #{n} · {repo}`. |
| 575 | pub fn edit_title(lang: Lang, number: i64, repo: &str) -> String { |
| 576 | match lang { |
| 577 | Lang::En => format!("Edit #{number} \u{b7} {repo}"), |
| 578 | Lang::Tr => format!("#{number} düzenle \u{b7} {repo}"), |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | /// The title of the comment edit page: `Edit comment on #{n} · {repo}`. |
| 583 | pub fn edit_comment_title(lang: Lang, number: i64, repo: &str) -> String { |
| 584 | match lang { |
| 585 | Lang::En => format!("Edit comment on #{number} \u{b7} {repo}"), |
| 586 | Lang::Tr => format!("#{number} sorunundaki yorumu düzenle \u{b7} {repo}"), |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | /// `{repo} · Issues`. |
| 591 | pub fn issues_title(lang: Lang, repo: &str) -> String { |
| 592 | match lang { |
| 593 | Lang::En => format!("{repo} \u{b7} Issues"), |
| 594 | Lang::Tr => format!("{repo} \u{b7} Sorunlar"), |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | /// `{repo} · New issue`. |
| 599 | pub fn new_issue_title(lang: Lang, repo: &str) -> String { |
| 600 | match lang { |
| 601 | Lang::En => format!("{repo} \u{b7} New issue"), |
| 602 | Lang::Tr => format!("{repo} \u{b7} Yeni sorun"), |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | /// `{repo} · Labels`. |
| 607 | pub fn labels_title(lang: Lang, repo: &str) -> String { |
| 608 | match lang { |
| 609 | Lang::En => format!("{repo} \u{b7} Labels"), |
| 610 | Lang::Tr => format!("{repo} \u{b7} Etiketler"), |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | /// `{repo} · Milestones`. |
| 615 | pub fn milestones_title(lang: Lang, repo: &str) -> String { |
| 616 | match lang { |
| 617 | Lang::En => format!("{repo} \u{b7} Milestones"), |
| 618 | Lang::Tr => format!("{repo} \u{b7} Kilometre taşları"), |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | /// `{repo} · Edit milestone`. |
| 623 | pub fn milestone_edit_title(lang: Lang, repo: &str) -> String { |
| 624 | match lang { |
| 625 | Lang::En => format!("{repo} \u{b7} Edit milestone"), |
| 626 | Lang::Tr => format!("{repo} \u{b7} Kilometre taşını düzenle"), |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | /// The reader text for the thing whose history is shown: `issue description`, `comment`, ... |
| 631 | pub fn history_what(lang: Lang, pull: bool, target_kind: &str) -> &'static str { |
| 632 | match target_kind { |
| 633 | "issue" if pull => t(lang, K::HistPullDescription), |
| 634 | "issue" => t(lang, K::HistIssueDescription), |
| 635 | "comment" => t(lang, K::HistComment), |
| 636 | _ => t(lang, K::HistReviewComment), |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | /// The history page title: `Edit history of the {what} · {suffix}`. |
| 641 | pub fn history_title(lang: Lang, what: &str, suffix: &str) -> String { |
| 642 | match lang { |
| 643 | Lang::En => format!("Edit history of the {what} \u{b7} {suffix}"), |
| 644 | Lang::Tr => format!("Düzenleme geçmişi: {what} \u{b7} {suffix}"), |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | /// The history page heading: `Edit history of the {what}`. |
| 649 | pub fn history_heading(lang: Lang, what: &str) -> String { |
| 650 | match lang { |
| 651 | Lang::En => format!("Edit history of the {what}"), |
| 652 | Lang::Tr => format!("Düzenleme geçmişi: {what}"), |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | /// The title change line in the edit history: `Title: {from} → {to}`. |
| 657 | pub fn title_change(lang: Lang, from: &str, to: &str) -> String { |
| 658 | match lang { |
| 659 | Lang::En => format!("Title: {from} \u{2192} {to}"), |
| 660 | Lang::Tr => format!("Başlık: {from} \u{2192} {to}"), |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | /// `{names} and {more} more` on a reaction's hover text. |
| 665 | pub fn reaction_more(lang: Lang, names: &str, more: usize) -> String { |
| 666 | match lang { |
| 667 | Lang::En => format!("{names} and {more} more"), |
| 668 | Lang::Tr => format!("{names} ve {more} daha"), |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | // Timeline event sentences. |
| 673 | |
| 674 | /// Several label additions in one run: "added labels a, b and c". `names` holds at least two. |
| 675 | pub fn event_labels_added(lang: Lang, names: &[String]) -> String { |
| 676 | let (last, rest) = names |
| 677 | .split_last() |
| 678 | .map_or(("", &[][..]), |(last, rest)| (last.as_str(), rest)); |
| 679 | let list = match lang { |
| 680 | Lang::En => match rest.is_empty() { |
| 681 | true => last.to_owned(), |
| 682 | false => format!("{} and {last}", rest.join(", ")), |
| 683 | }, |
| 684 | Lang::Tr => match rest.is_empty() { |
| 685 | true => last.to_owned(), |
| 686 | false => format!("{} ve {last}", rest.join(", ")), |
| 687 | }, |
| 688 | }; |
| 689 | match lang { |
| 690 | Lang::En => format!("added labels {list}"), |
| 691 | Lang::Tr => format!("{list} etiketlerini ekledi"), |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | pub fn event_label_added(lang: Lang, label: &str) -> String { |
| 696 | match lang { |
| 697 | Lang::En => format!("added the {label} label"), |
| 698 | Lang::Tr => format!("{label} etiketini ekledi"), |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | pub fn event_label_removed(lang: Lang, label: &str) -> String { |
| 703 | match lang { |
| 704 | Lang::En => format!("removed the {label} label"), |
| 705 | Lang::Tr => format!("{label} etiketini kaldırdı"), |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | pub fn event_assigned(lang: Lang, user: &str) -> String { |
| 710 | match lang { |
| 711 | Lang::En => format!("assigned {user}"), |
| 712 | Lang::Tr => format!("{user} kullanıcısını atadı"), |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | pub fn event_unassigned(lang: Lang, user: &str) -> String { |
| 717 | match lang { |
| 718 | Lang::En => format!("unassigned {user}"), |
| 719 | Lang::Tr => format!("{user} kullanıcısının atamasını kaldırdı"), |
| 720 | } |
| 721 | } |
| 722 | |
| 723 | pub fn event_milestone_added(lang: Lang, title: &str) -> String { |
| 724 | match lang { |
| 725 | Lang::En => format!("added this to the {title} milestone"), |
| 726 | Lang::Tr => format!("bunu {title} kilometre taşına ekledi"), |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | pub fn event_milestone_removed(lang: Lang, title: &str) -> String { |
| 731 | match lang { |
| 732 | Lang::En => format!("removed this from the {title} milestone"), |
| 733 | Lang::Tr => format!("bunu {title} kilometre taşından çıkardı"), |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | pub fn event_renamed(lang: Lang, from: &str, to: &str) -> String { |
| 738 | match lang { |
| 739 | Lang::En => format!("changed the title from {from} to {to}"), |
| 740 | Lang::Tr => format!("başlığı {from} yerine {to} olarak değiştirdi"), |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | pub fn event_locked_as(lang: Lang, reason: &str) -> String { |
| 745 | match lang { |
| 746 | Lang::En => format!("locked this conversation as {reason}"), |
| 747 | Lang::Tr => format!("bu tartışmayı {reason} olarak kilitledi"), |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | pub fn event_branch_deleted(lang: Lang, branch: &str) -> String { |
| 752 | match lang { |
| 753 | Lang::En => format!("deleted the {branch} branch"), |
| 754 | Lang::Tr => format!("{branch} dalını sildi"), |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | pub fn event_branch_restored(lang: Lang, branch: &str) -> String { |
| 759 | match lang { |
| 760 | Lang::En => format!("restored the {branch} branch"), |
| 761 | Lang::Tr => format!("{branch} dalını geri yükledi"), |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | pub fn event_ready_for_review(lang: Lang) -> String { |
| 766 | match lang { |
| 767 | Lang::En => "marked this pull request as ready for review".to_owned(), |
| 768 | Lang::Tr => "bu çekme isteğini incelemeye hazır olarak işaretledi".to_owned(), |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | pub fn event_converted_to_draft(lang: Lang) -> String { |
| 773 | match lang { |
| 774 | Lang::En => "converted this pull request to a draft".to_owned(), |
| 775 | Lang::Tr => "bu çekme isteğini taslağa çevirdi".to_owned(), |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | pub fn event_auto_merge_enabled(lang: Lang, style: &str) -> String { |
| 780 | match lang { |
| 781 | Lang::En => format!("enabled auto-merge ({style})"), |
| 782 | Lang::Tr => format!("otomatik birleştirmeyi açtı ({style})"), |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | pub fn event_auto_merge_disabled(lang: Lang, reason: &str) -> String { |
| 787 | match (lang, reason) { |
| 788 | (Lang::En, "push") => "Auto-merge was disabled because new commits were pushed".to_owned(), |
| 789 | (Lang::Tr, "push") => { |
| 790 | "Yeni commit'ler gönderildiği için otomatik birleştirme kapatıldı".to_owned() |
| 791 | } |
| 792 | (Lang::En, "refused") => { |
| 793 | "Auto-merge was disabled because the merge could not be completed".to_owned() |
| 794 | } |
| 795 | (Lang::Tr, "refused") => { |
| 796 | "Birleştirme tamamlanamadığı için otomatik birleştirme kapatıldı".to_owned() |
| 797 | } |
| 798 | (Lang::En, "permission") => { |
| 799 | "Auto-merge was disabled because its user can no longer merge".to_owned() |
| 800 | } |
| 801 | (Lang::Tr, "permission") => { |
| 802 | "Kullanıcı artık birleştiremediği için otomatik birleştirme kapatıldı".to_owned() |
| 803 | } |
| 804 | (Lang::En, _) => "disabled auto-merge".to_owned(), |
| 805 | (Lang::Tr, _) => "otomatik birleştirmeyi kapattı".to_owned(), |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | pub fn event_thread_resolved(lang: Lang, path: &str) -> String { |
| 810 | match lang { |
| 811 | Lang::En => format!("resolved a conversation on {path}"), |
| 812 | Lang::Tr => format!("{path} üzerindeki bir tartışmayı çözdü"), |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | pub fn event_thread_unresolved(lang: Lang, path: &str) -> String { |
| 817 | match lang { |
| 818 | Lang::En => format!("unresolved a conversation on {path}"), |
| 819 | Lang::Tr => format!("{path} üzerindeki bir tartışmayı yeniden açtı"), |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | pub fn event_base_changed(lang: Lang, from: &str, to: &str) -> String { |
| 824 | match lang { |
| 825 | Lang::En => format!("changed the base branch from {from} to {to}"), |
| 826 | Lang::Tr => format!("temel dalı {from} yerine {to} olarak değiştirdi"), |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | /// `into {branch}` after a merged event. |
| 831 | pub fn event_merged_into(lang: Lang, branch: &str) -> String { |
| 832 | match lang { |
| 833 | Lang::En => format!("into {branch}"), |
| 834 | Lang::Tr => format!("{branch} dalına"), |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | /// `from {a}..{b}` after a head update. |
| 839 | pub fn event_pushed_range(lang: Lang, from: &str, to: &str) -> String { |
| 840 | match lang { |
| 841 | Lang::En => format!("from {from}..{to}"), |
| 842 | Lang::Tr => format!("{from}..{to} arasında"), |
| 843 | } |
| 844 | } |
| 845 | |
| 846 | /// The lead-in before the sign-in link under a conversation: empty in English, and in Turkish the |
| 847 | /// purpose comes first, as in `Yorum yapmak için giriş yapın.` |
| 848 | pub fn comment_login_lead(lang: Lang) -> &'static str { |
| 849 | match lang { |
| 850 | Lang::En => "", |
| 851 | Lang::Tr => "Yorum yapmak için ", |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | /// The text on either side of a commit link in a `closed`, `referenced` or `merged` timeline |
| 856 | /// event, as `(before, after)`. `verb` is the localised verb, `branch` the base branch for |
| 857 | /// `merged` (empty when unknown) and `linked` whether the commit link is shown. English reads |
| 858 | /// `closed this in <link>` or `merged commit <link> into <branch>`. Turkish puts the commit first |
| 859 | /// and the verb last, so with a link the whole sentence moves after it: `<link> commit'inde ...`. |
| 860 | pub fn commit_event_sides( |
| 861 | lang: Lang, |
| 862 | kind: &str, |
| 863 | verb: &str, |
| 864 | branch: &str, |
| 865 | linked: bool, |
| 866 | ) -> (String, String) { |
| 867 | match (lang, kind) { |
| 868 | (Lang::En, "merged") => { |
| 869 | let after = if branch.is_empty() { |
| 870 | String::new() |
| 871 | } else { |
| 872 | event_merged_into(lang, branch) |
| 873 | }; |
| 874 | (verb.to_owned(), after) |
| 875 | } |
| 876 | (Lang::En, _) if linked => (format!("{verb}{}", t(lang, K::InCommit)), String::new()), |
| 877 | (Lang::En, _) => (verb.to_owned(), String::new()), |
| 878 | (Lang::Tr, "merged") => { |
| 879 | let sentence = if branch.is_empty() { |
| 880 | t(lang, K::MergedCommit).to_owned() |
| 881 | } else { |
| 882 | format!("commit'i {branch} dalına birleştirdi") |
| 883 | }; |
| 884 | if linked { |
| 885 | (String::new(), sentence) |
| 886 | } else { |
| 887 | (sentence, String::new()) |
| 888 | } |
| 889 | } |
| 890 | (Lang::Tr, _) if linked => (String::new(), format!("{} {verb}", t(lang, K::InCommit))), |
| 891 | (Lang::Tr, _) => (verb.to_owned(), String::new()), |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | #[cfg(test)] |
| 896 | mod tests { |
| 897 | use super::{K, Lang, commit_event_sides, t}; |
| 898 | |
| 899 | const ALL: &[K] = &[ |
| 900 | K::CouldNotSave, |
| 901 | K::GoBack, |
| 902 | K::Issues, |
| 903 | K::Labels, |
| 904 | K::Milestones, |
| 905 | K::Pinned, |
| 906 | K::Comment, |
| 907 | K::Edit, |
| 908 | K::Delete, |
| 909 | K::Title, |
| 910 | K::Description, |
| 911 | K::Cancel, |
| 912 | K::Name, |
| 913 | K::Color, |
| 914 | K::Reason, |
| 915 | K::None, |
| 916 | K::Open, |
| 917 | K::Closed, |
| 918 | K::Search, |
| 919 | K::Sort, |
| 920 | K::Unknown, |
| 921 | K::System, |
| 922 | K::Edited, |
| 923 | K::EditedBy, |
| 924 | K::Raw, |
| 925 | K::IssuePages, |
| 926 | K::PinIssue, |
| 927 | K::UnpinIssue, |
| 928 | K::PinnedTopNote, |
| 929 | K::PinnedIssues, |
| 930 | K::LockOffTopic, |
| 931 | K::LockTooHeated, |
| 932 | K::LockResolved, |
| 933 | K::LockSpam, |
| 934 | K::OptOffTopic, |
| 935 | K::OptTooHeated, |
| 936 | K::OptResolved, |
| 937 | K::OptSpam, |
| 938 | K::ConversationLocked, |
| 939 | K::ArchivedIssuesReadOnly, |
| 940 | K::LogIn, |
| 941 | K::LogInLink, |
| 942 | K::ToComment, |
| 943 | K::ClosedCompleted, |
| 944 | K::ClosedNotPlanned, |
| 945 | K::ClosedThis, |
| 946 | K::ReopenedThis, |
| 947 | K::ReferencedThis, |
| 948 | K::LockedConversation, |
| 949 | K::UnlockedConversation, |
| 950 | K::PinnedThisIssue, |
| 951 | K::UnpinnedThisIssue, |
| 952 | K::MergedCommit, |
| 953 | K::PushedNewCommits, |
| 954 | K::DeletedHeadBranch, |
| 955 | K::InCommit, |
| 956 | K::ReviewDismissedPrefix, |
| 957 | K::StateClosedNotPlanned, |
| 958 | K::SaveChanges, |
| 959 | K::EditComment, |
| 960 | K::SaveComment, |
| 961 | K::ApprovedChanges, |
| 962 | K::RequestedChanges, |
| 963 | K::Reviewed, |
| 964 | K::ApprovedDismissed, |
| 965 | K::RequestedDismissed, |
| 966 | K::ReviewedDismissed, |
| 967 | K::DismissedPrefix, |
| 968 | K::AddReaction, |
| 969 | K::NoDescription, |
| 970 | K::NoRepoLabels, |
| 971 | K::SaveLabels, |
| 972 | K::NoneYet, |
| 973 | K::Assignees, |
| 974 | K::SaveAssignees, |
| 975 | K::AssignToMe, |
| 976 | K::MilestoneBox, |
| 977 | K::NoneOption, |
| 978 | K::SaveMilestone, |
| 979 | K::ConversationBox, |
| 980 | K::Locked, |
| 981 | K::UnlockConversation, |
| 982 | K::NoReason, |
| 983 | K::LockConversation, |
| 984 | K::LockedToCollaborators, |
| 985 | K::AddComment, |
| 986 | K::CloseCompleted, |
| 987 | K::CloseNotPlanned, |
| 988 | K::Add, |
| 989 | K::Close, |
| 990 | K::Reopen, |
| 991 | K::CommentEmpty, |
| 992 | K::LabelsArchived, |
| 993 | K::NoLabelsYet, |
| 994 | K::AddDefaultLabels, |
| 995 | K::SaveLabel, |
| 996 | K::NewLabel, |
| 997 | K::CreateLabel, |
| 998 | K::OpenLabelCount, |
| 999 | K::MilestonesArchived, |
| 1000 | K::Overdue, |
| 1001 | K::MilestoneState, |
| 1002 | K::NoClosedMilestones, |
| 1003 | K::NoOpenMilestones, |
| 1004 | K::NewMilestone, |
| 1005 | K::DueDate, |
| 1006 | K::CreateMilestone, |
| 1007 | K::EditMilestone, |
| 1008 | K::BackToMilestones, |
| 1009 | K::StateLabel, |
| 1010 | K::ClosedMilestoneCount, |
| 1011 | K::OpenMilestoneCount, |
| 1012 | K::OpenIssue, |
| 1013 | K::ClosedIssue, |
| 1014 | K::SortNewest, |
| 1015 | K::SortOldest, |
| 1016 | K::SortUpdated, |
| 1017 | K::NewIssue, |
| 1018 | K::NoIssuesMatch, |
| 1019 | K::NoIssuesYet, |
| 1020 | K::SearchTitles, |
| 1021 | K::FiltersApplied, |
| 1022 | K::ClearFilters, |
| 1023 | K::Opened, |
| 1024 | K::By, |
| 1025 | K::ChooseTemplate, |
| 1026 | K::BlankIssue, |
| 1027 | K::SubmitNewIssue, |
| 1028 | K::Newer, |
| 1029 | K::Older, |
| 1030 | K::HistIssueDescription, |
| 1031 | K::HistPullDescription, |
| 1032 | K::HistComment, |
| 1033 | K::HistReviewComment, |
| 1034 | K::NoEarlierVersions, |
| 1035 | ]; |
| 1036 | |
| 1037 | #[test] |
| 1038 | fn every_key_has_both_languages() { |
| 1039 | let mut differing = 0; |
| 1040 | for key in ALL { |
| 1041 | let en = t(Lang::En, *key); |
| 1042 | let tr = t(Lang::Tr, *key); |
| 1043 | assert!(!en.is_empty(), "{key:?} has no English text"); |
| 1044 | assert!(!tr.is_empty(), "{key:?} has no Turkish text"); |
| 1045 | if en != tr { |
| 1046 | differing += 1; |
| 1047 | } |
| 1048 | } |
| 1049 | assert!(differing >= 3, "only {differing} keys differ from English"); |
| 1050 | } |
| 1051 | |
| 1052 | #[test] |
| 1053 | fn english_commit_sides_are_unchanged() { |
| 1054 | let (before, after) = commit_event_sides(Lang::En, "closed", "closed this", "", true); |
| 1055 | assert_eq!((before.as_str(), after.as_str()), ("closed this in", "")); |
| 1056 | let (before, after) = commit_event_sides(Lang::En, "merged", "merged commit", "main", true); |
| 1057 | assert_eq!( |
| 1058 | (before.as_str(), after.as_str()), |
| 1059 | ("merged commit", "into main") |
| 1060 | ); |
| 1061 | let (before, after) = commit_event_sides(Lang::En, "merged", "merged commit", "", false); |
| 1062 | assert_eq!((before.as_str(), after.as_str()), ("merged commit", "")); |
| 1063 | } |
| 1064 | } |