@virusis/angular-ui 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9715,8 +9715,39 @@ function verdictFor(backendOk, authOk) {
9715
9715
  * 🔴 Üç durum AYRI: "giriş servisi kapalı" ile "arka uç kapalı" farklı şeyler
9716
9716
  * ve kullanıcının yapacağı şey de farklı. Tek bir "bir şeyler ters gitti"
9717
9717
  * mesajı, destek çağrısında hiçbir bilgi taşımaz.
9718
+ *
9719
+ * 🔴 Dil (0.1.11): önceden yalnız Türkçeydi; iki dilli konsollarda İngilizce kullanıcı
9720
+ * kesinti ekranını Türkçe okuyordu. `language` serbest metin — konsollar onu
9721
+ * `translate.currentLang` gibi yerlerden veriyor (`en`, `en-GB`, `en-US`). `en` ile
9722
+ * başlayan her dil İngilizce; verilmeyen ya da tanınmayan dil Türkçe (mevcut davranış).
9718
9723
  */
9719
- function messageFor(verdict) {
9724
+ function messageFor(verdict, language = 'tr-TR') {
9725
+ return language.trim().toLowerCase().startsWith('en') ? englishMessageFor(verdict) : turkishMessageFor(verdict);
9726
+ }
9727
+ function englishMessageFor(verdict) {
9728
+ switch (verdict) {
9729
+ case 'auth-down':
9730
+ return {
9731
+ title: 'The sign-in service can’t be reached',
9732
+ description: 'The authentication service isn’t responding right now. You can try signing in again in a few ' +
9733
+ 'minutes; nothing is wrong with your account.',
9734
+ };
9735
+ case 'backend-down':
9736
+ return {
9737
+ title: 'The service can’t be reached',
9738
+ description: 'The application server isn’t responding right now. Even if you signed in, your data couldn’t load.',
9739
+ };
9740
+ case 'both-down':
9741
+ return {
9742
+ title: 'The system is unavailable right now',
9743
+ description: 'Neither the application server nor the authentication service can be reached. ' +
9744
+ 'This is usually a temporary outage.',
9745
+ };
9746
+ case 'healthy':
9747
+ return { title: '', description: '' };
9748
+ }
9749
+ }
9750
+ function turkishMessageFor(verdict) {
9720
9751
  switch (verdict) {
9721
9752
  case 'auth-down':
9722
9753
  return {