diff --git a/languages/ar.ini b/languages/ar.ini index 18681b0e699..2cd8029b59a 100644 --- a/languages/ar.ini +++ b/languages/ar.ini @@ -1000,7 +1000,7 @@ password_minimum_length = "الحد الأدنى لطول كلمة المرور password_only_alphanumeric = "أرقام وحروف أبجدية فقط" password_only_numeric = "أرقام فقط" Passwords do not match = "كلمة المرور غير متطابقة" -past_days = "الـ%%range%% أيام السابقة" +past_days = "{range, plural, =1 {الأمس} other {الـ# أيام السابقة}}" patron_account_expires = "ينتهي" patron_status_address_missing = "عنوانك مفقود." patron_status_card_blocked = "بطاقة المكتبة هذه محظورة من الاستعارة." @@ -1453,7 +1453,6 @@ widen_prefix = "حاول توسيع بحثك إلى" wiki_link = "مقدم من ويكيبيديا" with filters = "بالمنقحات" Year of Publication = "سنة النشر" -Yesterday = "الأمس" You do not have any fines = "لا توجد لديك أي غرامات" You do not have any holds or recalls placed = "لا يوجد لديك أي حجوزات أو استدعاءات" You do not have any interlibrary loan requests placed = "لا توجد لديك أي طلبات استعارة ما بين المكتبات" diff --git a/languages/bn.ini b/languages/bn.ini index e5c7ffecfe7..a41373d268f 100644 --- a/languages/bn.ini +++ b/languages/bn.ini @@ -1001,7 +1001,7 @@ password_minimum_length = "সর্বনিম্ন পাসওয়ার password_only_alphanumeric = "সংখ্যা এবং বর্ণ (A-Z)" password_only_numeric = "শুধুমাত্র সংখ্যা" Passwords do not match = "পাসওয়ার্ড মিলছে না" -past_days = "অতীত %%range%% দিনগুলি" +past_days = "{range, plural, =1 {গতকাল} other {অতীত # দিনগুলি}}" patron_account_expires = "মেয়াদ শেষ" patron_status_address_missing = "আপনার ঠিকানা উপলব্ধ নয়।" patron_status_card_blocked = "এই গ্রন্থাগার কার্ড অবরুদ্ধ করা হয়েছে।" @@ -1454,7 +1454,6 @@ widen_prefix = "আপনার সন্ধানকে প্রসারে wiki_link = "উইকিপিডিয়া দ্বারা উপলব্ধ" with filters = "ফিল্টার দিয়ে" Year of Publication = "প্রকাশনার বছর" -Yesterday = "গতকাল" You do not have any fines = "আপনার কোন জরিমানা নেই" You do not have any holds or recalls placed = "আপনি কোন হোল্ড রাখেন নি বা তলব স্থাপন করেননি" You do not have any interlibrary loan requests placed = "আপনার কোনো আন্তঃগ্রন্থাগার ঋণ অনুরোধ নেই" diff --git a/languages/ca.ini b/languages/ca.ini index ef057675249..b36cbfca997 100644 --- a/languages/ca.ini +++ b/languages/ca.ini @@ -1011,7 +1011,7 @@ password_minimum_length = "El password ha tenor almenys %%minlength%% caracters" password_only_alphanumeric = "Números i lletres A-Z només" password_only_numeric = "Només números" Passwords do not match = "Les contrasenyes no coincideixen" -past_days = "Anterior %%range%% Días" +past_days = "{range, plural, =1 {Ahir} other {Anterior # Días}}" patron_account_expires = "Caduca" patron_status_address_missing = "No hi ha la seva adreça." patron_status_card_blocked = "El seu compte està bloquejat per a préstecs." @@ -1464,7 +1464,6 @@ widen_prefix = "Amplia la teva cerca a" wiki_link = "Proporcionat per Wikipedia" with filters = "amb filtres" Year of Publication = "Any de publicació" -Yesterday = "Ahir" You do not have any fines = "No teniu cap sanció" You do not have any holds or recalls placed = "No teniu cap reserva o reclamació" You do not have any interlibrary loan requests placed = "No has fet cap petició de prèstec interbibliotecari" diff --git a/languages/cs.ini b/languages/cs.ini index 816931e2a26..61d63a087fb 100644 --- a/languages/cs.ini +++ b/languages/cs.ini @@ -998,7 +998,7 @@ password_minimum_length = "Heslo musí být dlouhé alespoň %%minlength%% znak password_only_alphanumeric = "Pouze čísla a písmena A-Z" password_only_numeric = "Pouze čísla" Passwords do not match = "Hesla se neshodují" -past_days = "Za posledních %%range%% dnů" +past_days = "{range, plural, =1 {Od včerejška} other {Za posledních # dnů}}" patron_account_expires = "Konec platnosti registrace" patron_status_address_missing = "U Vašeho účtu chybí adresa." patron_status_card_blocked = "Tento čtenářský průkaz byl zablokován." @@ -1451,7 +1451,6 @@ widen_prefix = "Zkuste rozšířit hledání na" wiki_link = "Získáno z Wikipedie" with filters = "S omezeními" Year of Publication = "Rok vydání" -Yesterday = "Od včerejška" You do not have any fines = "Nemáte žádné upomínky" You do not have any holds or recalls placed = "Nemáte žádné rezervace ani objednávky" You do not have any interlibrary loan requests placed = "Nemáte žádné nevyřízené požadavky na meziknihovní výpůjčky" diff --git a/languages/cy.ini b/languages/cy.ini index f0293bf9e71..66dd07a31d3 100644 --- a/languages/cy.ini +++ b/languages/cy.ini @@ -886,7 +886,7 @@ password_minimum_length = "Rhaid i'r cyfrinair gynnwys o leiaf %%minlength%% nod password_only_alphanumeric = "Rhifau a llythrennau, A-Z yn unig" password_only_numeric = "Rhifau yn unig" Passwords do not match = "Nid yw'r cyfrineiriau yr un peth" -past_days = "Gorffennol %%range%% Dyddiau" +past_days = "{range, plural, =1 {Ddoe} other {Gorffennol # Dyddiau}}" patron_account_expires = "Diwedd" patron_status_address_missing = "Mae eich cyfeiriad ar goll." patron_status_card_blocked = "Mae'r cerdyn llyfrgell hwn wedi'i atal rhag benthyca." @@ -1278,7 +1278,6 @@ widen_prefix = "Cewch geisio ehangu'ch chwiliad i" wiki_link = "Darparwyd gan Wikipedia" with filters = "gyda hidlwyr" Year of Publication = "Blwyddyn Gyhoeddi" -Yesterday = "Ddoe" You do not have any fines = "Nid oes gennych unrhyw ddirwyon" You do not have any holds or recalls placed = "Nid ydych wedi gosod unrhyw ddaliadau neu adalwadau" You do not have any interlibrary loan requests placed = "Nid oes gennych yr un cais am Fenthyciad Rhwnglyfrgellol" diff --git a/languages/da.ini b/languages/da.ini index e003affce27..dcd7ef30335 100644 --- a/languages/da.ini +++ b/languages/da.ini @@ -475,7 +475,7 @@ Password = "Password" Password Again = "Password igen" Password cannot be blank = "Password skal udfyldes" Passwords do not match = "Passwords er ikke ens" -past_days = "Tidligere %%range%% Dage" +past_days = "{range, plural, =1 {Igår} other {Tidligere # Dage}}" patron_account_expires = "Udløber" peer_reviewed_limit = "Afgræns til artikler fra peer-reviewed tidsskrifter" Phone Number = "Telefonnummer" @@ -672,7 +672,6 @@ Web = "Web" wiki_link = "Fra Wikipedia" with filters = "med filtre" Year of Publication = "Udgivelsesår" -Yesterday = "Igår" You do not have any fines = "Du har ingen bøder" You do not have any holds or recalls placed = "Du har ingen lån eller hjemkaldelser" You do not have any items checked out = "Du har ingen udlån" diff --git a/languages/de.ini b/languages/de.ini index 4c177b33487..135958c84a3 100644 --- a/languages/de.ini +++ b/languages/de.ini @@ -999,7 +999,7 @@ password_minimum_length = "Die minimale Länge des Passworts beträgt %%minlengt password_only_alphanumeric = "Nur Zahlen und Buchstaben A-Z" password_only_numeric = "Nur Zahlen" Passwords do not match = "Die Passwörter stimmen nicht überein" -past_days = "seit %%range%% Tagen" +past_days = "{range, plural, =1 {Gestern} other {seit # Tagen}}" patron_account_expires = "Ablaufdatum" patron_status_address_missing = "Ihre Adressangaben sind unvollständig." patron_status_card_blocked = "Dieser Bibliotheksausweis ist für die Ausleihe gesperrt." @@ -1452,7 +1452,6 @@ widen_prefix = "Versuchen Sie die Suche auszuweiten nach" wiki_link = "Veröffentlicht in Wikipedia" with filters = "mit Suchfiltern" Year of Publication = "Erscheinungsjahr" -Yesterday = "Gestern" You do not have any fines = "Es sind keine Gebühren auf Ihrem Bibliothekskonto" You do not have any holds or recalls placed = "Es liegen keine Vormerkungen oder Bestellungen vor" You do not have any interlibrary loan requests placed = "Sie haben keine offenen Fernleihanfragen" diff --git a/languages/el.ini b/languages/el.ini index c6194d2119f..6f01eec04c9 100644 --- a/languages/el.ini +++ b/languages/el.ini @@ -997,7 +997,7 @@ password_minimum_length = "Ο ελάχιστος αριθμός χαρακτήρ password_only_alphanumeric = "Αριθμοί και γράμματα A-Z μόνο" password_only_numeric = "Αριθμοί μόνο" Passwords do not match = "Οι κωδικοί δε συμφωνούν" -past_days = "Τελευταίες %%range%% Ημέρες" +past_days = "{range, plural, =1 {Χτες} other {Τελευταίες # Ημέρες}}" patron_account_expires = "Λήξη" patron_status_address_missing = "Λείπει η διεύθυνσή σας." patron_status_card_blocked = "Υπάρχει απαγόρευση δανεισμών για αυτή την κάρτα βιβλιοθήκης." @@ -1448,7 +1448,6 @@ widen_prefix = "Διευρύνετε την έρευνά σας σε" wiki_link = "Παρέχεται από τη Wikipedia" with filters = "με φίλτρα" Year of Publication = "Έτος έκδοσης" -Yesterday = "Χτες" You do not have any fines = "Δεν έχετε πρόστιμα" You do not have any holds or recalls placed = "Δεν έχετε αιτήματα κράτησης ή ανάκλησης" You do not have any interlibrary loan requests placed = "Δεν έχετε υποβάλει κάποιο αίτημα διαδανεισμού" diff --git a/languages/en.ini b/languages/en.ini index 090244767c5..9ffe65c5858 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -1004,7 +1004,7 @@ password_minimum_length = "Minimum password length is %%minlength%% characters" password_only_alphanumeric = "Numbers and letters A-Z only" password_only_numeric = "Numbers only" Passwords do not match = "Passwords do not match" -past_days = "Past %%range%% Days" +past_days = "{range, plural, =1 {Yesterday} =7 {Past Week} other {Past # Days}}" patron_account_expires = "Expires" patron_status_address_missing = "Your address is missing." patron_status_card_blocked = "This library card is blocked from borrowing." @@ -1457,7 +1457,6 @@ widen_prefix = "Try widening your search to" wiki_link = "Provided by Wikipedia" with filters = "with filters" Year of Publication = "Year of Publication" -Yesterday = "Yesterday" You do not have any fines = "You do not have any fines" You do not have any holds or recalls placed = "You do not have any holds or recalls placed" You do not have any interlibrary loan requests placed = "You do not have any interlibrary loan requests placed" diff --git a/languages/es.ini b/languages/es.ini index 1d22110a049..2eb4628f296 100644 --- a/languages/es.ini +++ b/languages/es.ini @@ -1000,7 +1000,7 @@ password_minimum_length = "Longitud mínima de la contraeña son %%minlength%% c password_only_alphanumeric = "Sólo números y letras A-Z" password_only_numeric = "Sólo números" Passwords do not match = "La Contraseña no coincide" -past_days = "Pasado %%range%% Días" +past_days = "{range, plural, =1 {Ayer} other {Pasado # Días}}" patron_account_expires = "Expira" patron_status_address_missing = "Tu dirección falta." patron_status_card_blocked = "Esta tarjeta de la biblioteca está bloqueada para préstamos." @@ -1453,7 +1453,6 @@ widen_prefix = "Intente ampliando su búsqueda a" wiki_link = "proporcionado por Wikipedia" with filters = "con filtros" Year of Publication = "Año de Publicación" -Yesterday = "Ayer" You do not have any fines = "Usted no tiene multas" You do not have any holds or recalls placed = "No tiene reservas ni reclamos" You do not have any interlibrary loan requests placed = "No tiene ninguna solicitud de préstamo interbibliotecario colocada" diff --git a/languages/eu.ini b/languages/eu.ini index cece56072d5..21ecb788aaa 100644 --- a/languages/eu.ini +++ b/languages/eu.ini @@ -1395,7 +1395,7 @@ password_minimum_length = "Pasahitzarako gutxieneko luzapena da %%minlength%% ka password_only_alphanumeric = "Pasahitzak bakarrik A-Z onartzen du" password_only_numeric = "Bakarrik zenbakiak" Passwords do not match = "Pasahitza ez da egokia" -past_days = "Azken %%range%% Egunak" +past_days = "{range, plural, =1 {Atzo} other {Azken # Egunak}}" patron_account_expires = "Amaitua" PDF Full Text = "PDF testu osoa" peer_reviewed = "Pareek aztertuta" @@ -1755,7 +1755,6 @@ widen_prefix = "Saia zaitez zure bilaketa zabaltzen honekin" wiki_link = "Wikipediatik informazioa lortu" with filters = "iragazkiekin" Year of Publication = "Argitaratze-urtea" -Yesterday = "Atzo" You do not have any fines = "Ez daukazu isunik" You do not have any holds or recalls placed = "Ez daukazu erreserbarik" You do not have any interlibrary loan requests placed = "Ez duzu eskatu liburutegi arteko mailegurik" diff --git a/languages/fi.ini b/languages/fi.ini index 7785f4f1c86..a621f4f3472 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -998,7 +998,7 @@ password_minimum_length = "Salasanan vähimmäispituus on %%minlength%% merkkiä password_only_alphanumeric = "Vain numerot ja kirjaimet a-z" password_only_numeric = "Vain numerot" Passwords do not match = "Salasanat eivät täsmää" -past_days = "Viimeiset %%range%% päivää" +past_days = "{range, plural, =1 {Eilisestä} other {Viimeiset # päivää}}" patron_account_expires = "Vanhenee" patron_status_address_missing = "Osoitetietosi ovat puutteelliset." patron_status_card_blocked = "Kirjastokorttisi on lainauskiellossa." @@ -1451,7 +1451,6 @@ widen_prefix = "Kokeile laajentaa hakua:" wiki_link = "Wikipedian tuottama" with filters = "suodattimilla" Year of Publication = "Julkaisuvuosi" -Yesterday = "Eilisestä" You do not have any fines = "Ei maksamattomia maksuja" You do not have any holds or recalls placed = "Ei voimassaolevia varauksia" You do not have any interlibrary loan requests placed = "Ei voimassaolevia kaukolainatilauksia" diff --git a/languages/fr.ini b/languages/fr.ini index 231ea43b395..a3b90726cf3 100644 --- a/languages/fr.ini +++ b/languages/fr.ini @@ -999,7 +999,7 @@ password_minimum_length = "Longueur minimum du mot de passe : %%minlength%% cara password_only_alphanumeric = "Chiffres et lettres A-Z seulement" password_only_numeric = "Chiffres seulement" Passwords do not match = "Les mots de passe ne correspondent pas" -past_days = "Depuis %%range%% Jours" +past_days = "{range, plural, =1 {Hier} other {Depuis # Jours}}" patron_account_expires = "Echéance" patron_status_address_missing = "Il manque votre adresse." patron_status_card_blocked = "Votre carte de bibliothèque est bloquée, vous ne pouvez pas faire d'emprunts." @@ -1452,7 +1452,6 @@ widen_prefix = "Veuillez élargir votre recherche" wiki_link = "Informations fournies par Wikipedia" with filters = "avec filtres" Year of Publication = "Année de publication" -Yesterday = "Hier" You do not have any fines = "Vous n'avez pas d'amende" You do not have any holds or recalls placed = "Vous n'avez pas de réservation ni de rappel" You do not have any interlibrary loan requests placed = "Vous n'avez aucune demande de prêt entre bibliothèques en cours" diff --git a/languages/ga.ini b/languages/ga.ini index 3c9c2718cb3..308ca0a785c 100644 --- a/languages/ga.ini +++ b/languages/ga.ini @@ -997,7 +997,7 @@ password_minimum_length = "Ní féidir níos lú ná %%maxlength%% carachtar a b password_only_alphanumeric = "Uimhreacha agus na litreacha A-Z amháin" password_only_numeric = "Uimhreacha amháin" Passwords do not match = "Níl na pasfhocail ag teacht le chéile" -past_days = "Roimhe seo %%range%% Laethanta" +past_days = "{range, plural, =1 {Inné} other {Roimhe seo # Laethanta}}" patron_account_expires = "Imíonn as feidhm" patron_status_address_missing = "Tá do sheoladh ar iarraidh." patron_status_card_blocked = "Tá bac curtha ar an gcárta leabharlainne seo a fhágann nach féidir míreanna a ghlacadh ar iasacht leis." @@ -1450,7 +1450,6 @@ widen_prefix = "Bain triail as do chuardach a leathnú go" wiki_link = "Arna chur ar fáil ag Vicipéid" with filters = "le scagairí" Year of Publication = "Bliain a fhoilsithe" -Yesterday = "Inné" You do not have any fines = "Níl aon fhíneálacha agat" You do not have any holds or recalls placed = "Níl aon choinneálacha ná aisghairmeacha curtha agat" You do not have any interlibrary loan requests placed = "Níl aon iarratais ar iasacht idirleabharlainne déanta agat" diff --git a/languages/gl.ini b/languages/gl.ini index 3899ecd5ba6..29e5c0fac84 100644 --- a/languages/gl.ini +++ b/languages/gl.ini @@ -697,7 +697,7 @@ password_error_not_unique = "O contrasinal non se cambiou" password_maximum_length = "Lonxitude máxima do contrasinal son %%maxlength%% caracteres" password_minimum_length = "Lonxitude mínima do contrasinal son %%minlength%% caracteres" Passwords do not match = "O contrasinal non coincide" -past_days = "Pasado %%range%% Días" +past_days = "{range, plural, =1 {Pasado 1 Día} other {Pasado # Días}}" patron_account_expires = "Expira" PDF Full Text = "Texto completo PDF" peer_reviewed = "Revisado por Pares" diff --git a/languages/he.ini b/languages/he.ini index 9f7bc187d36..2cdd3ccc075 100644 --- a/languages/he.ini +++ b/languages/he.ini @@ -541,7 +541,7 @@ Password = "סיסמה" Password Again = "סיסמה שוב" Password cannot be blank = "סיסמה לא יכולה להיות ריקה" Passwords do not match = "סיסמאות לא תואמות" -past_days = "עבר %%range%% ימים" +past_days = "{range, plural, =1 {אתמול} other {עבר # ימים}}" patron_account_expires = "פג תוקף" peer_reviewed_limit = "הגבלה לפריטים מכתבי עת" Phone Number = "מספר טלפון" @@ -769,7 +769,6 @@ widen_prefix = "נסו להרחיב את החיפוש ל" wiki_link = "באדיבות וויקיפדיה" with filters = "עם מסננים" Year of Publication = "שנת הוצאה לאור" -Yesterday = "אתמול" You do not have any fines = "אין לך שום קנסות" You do not have any holds or recalls placed = "אין לך שום הזמנות או בקשות החזרה קיימות" You do not have any items checked out = "אין לך שום פריטים רשומים להשאלה" diff --git a/languages/hi.ini b/languages/hi.ini index 4f63730e264..7d6967e828d 100644 --- a/languages/hi.ini +++ b/languages/hi.ini @@ -1001,7 +1001,7 @@ password_minimum_length = "न्यूनतम पासवर्ड लंब password_only_alphanumeric = "संख्या और अक्षर केवल ए-जेड" password_only_numeric = "केवल संख्या" Passwords do not match = "पासवर्ड मेल नहीं खाते" -past_days = "पिछला %%range%% दिन" +past_days = "{range, plural, =1 {बिता कल} other {पिछला # दिन}}" patron_account_expires = "समय-सीमा समाप्त" patron_status_address_missing = "आपका पता अनुपलब्ध है।" patron_status_card_blocked = "इस पुस्तकालय कार्ड पर लेन-देन की सुविधा अवरुद्ध है।" @@ -1454,7 +1454,6 @@ widen_prefix = "अपनी खोज को विस्तृत करने wiki_link = "विकिपीडिया द्वारा प्रदान किया गया" with filters = "फ़िल्टर के साथ" Year of Publication = "प्रकाशन का वर्ष" -Yesterday = "बिता कल" You do not have any fines = "आपके पास कोई जुर्माना नहीं है" You do not have any holds or recalls placed = "आपके पास कोई होल्ड या रिकॉल नहीं है" You do not have any interlibrary loan requests placed = "आपके पास कोई भी अंतःक्रियात्मक ऋण अनुरोध नहीं है" diff --git a/languages/hr.ini b/languages/hr.ini index e42e105f76f..1c9a3e9d710 100644 --- a/languages/hr.ini +++ b/languages/hr.ini @@ -1000,7 +1000,7 @@ password_minimum_length = "Minimalni broj znakova za lozinku: %%minlength%%" password_only_alphanumeric = "Samo brojke i slova A-Z" password_only_numeric = "Samo brojke" Passwords do not match = "Lozinke se ne poklapaju" -past_days = "Zadnjih %%range%% dana" +past_days = "{range, plural, =1 {Jučer} other {Zadnjih # dana}}" patron_account_expires = "Isteče" patron_status_address_missing = "Nedostaje tvoja adresa." patron_status_card_blocked = "Tvoja je članska iskaznica blokirana." @@ -1453,7 +1453,6 @@ widen_prefix = "Pokušaj proširiti pretragu na" wiki_link = "Omogućuje Wikipedia" with filters = "s filtrima" Year of Publication = "Godina izdanja" -Yesterday = "Jučer" You do not have any fines = "Nemaš zakasnina" You do not have any holds or recalls placed = "Nemaš postavljenih narudžbi ili rezervacija" You do not have any interlibrary loan requests placed = "Nemaš postavljenih zahtjeva za međuknjižničnu posudbu" diff --git a/languages/hy.ini b/languages/hy.ini index 5a4d2c24845..3c27140c90a 100644 --- a/languages/hy.ini +++ b/languages/hy.ini @@ -999,7 +999,7 @@ password_minimum_length = "Գաղտնաբառի նվազագույն երկար password_only_alphanumeric = "Թվեր և A-Z տառեր միայն" password_only_numeric = "Միայն թվեր" Passwords do not match = "Գաղտնաբառերը չեն համապատասխանում" -past_days = "Նախորդ %%range%% օրերը" +past_days = "{range, plural, =1 {Երեկ} other {Նախորդ # օրերը}}" patron_account_expires = "Սպառվում է" patron_status_address_missing = "Ձեր հասցեն բացակայում է:" patron_status_card_blocked = "Գրադարանի այս քարտն արգելափակված է տացքի համար:" @@ -1452,7 +1452,6 @@ widen_prefix = "Փորձեք ընդլայնել ձեր որոնումը դեպի wiki_link = "Տրամադրված է Վիքիպեդիայի կողմից" with filters = "զտիչներով" Year of Publication = "Հրատարակման տարի" -Yesterday = "Երեկ" You do not have any fines = "Դուք տուգանքներ չունեք" You do not have any holds or recalls placed = "Դուք չունեք պահումներ կամ հետկանչեր տեղադրված" You do not have any interlibrary loan requests placed = "Դուք չունեք միջգրադարանային բաժնույթի հարցումներ" diff --git a/languages/it.ini b/languages/it.ini index 187d0bff2a8..20714a80f0b 100644 --- a/languages/it.ini +++ b/languages/it.ini @@ -999,7 +999,7 @@ password_minimum_length = "La lunghezza minima della password è di %%maxlength% password_only_alphanumeric = "Solo numeri e lettere A-Z" password_only_numeric = "Solo numeri" Passwords do not match = "Le password non coincidono" -past_days = "Ultimi %%range%% Giorni" +past_days = "{range, plural, =1 {Ieri} other {Ultimi # Giorni}}" patron_account_expires = "Termina" patron_status_address_missing = "Il tuo indirizzo manca." patron_status_card_blocked = "La tua tessera bibliotecaria è bloccata dal prestito." @@ -1452,7 +1452,6 @@ widen_prefix = "Prova anche ad ampliare la ricerca" wiki_link = "da Wikipedia" with filters = "con filtri" Year of Publication = "Anno di pubblicazione" -Yesterday = "Ieri" You do not have any fines = "Non hai alcuna sanzione" You do not have any holds or recalls placed = "Non hai prenotazioni o richieste in atto" You do not have any interlibrary loan requests placed = "Non hai alcuna richiesta di prestito interbibliotecario in corso" diff --git a/languages/ja.ini b/languages/ja.ini index 4c07ac6f708..49bd7fcb3a4 100644 --- a/languages/ja.ini +++ b/languages/ja.ini @@ -1000,7 +1000,7 @@ password_minimum_length = "パスワードは最低%%minlength%%文字必要で password_only_alphanumeric = "番号および A-Zの文字のみ" password_only_numeric = "番号のみ" Passwords do not match = "パスワードが間違っています" -past_days = "過去 %%range%% 日以内" +past_days = "{range, plural, =1 {昨日} other {過去 # 日以内}}" patron_account_expires = "有効期限" patron_status_address_missing = "住所が未登録です。" patron_status_card_blocked = "この図書カードは貸し出しが禁止されています。" @@ -1453,7 +1453,6 @@ widen_prefix = "検索範囲を拡大" wiki_link = "Wikipediaによる" with filters = "フィルター適用" Year of Publication = "出版年" -Yesterday = "昨日" You do not have any fines = "延滞金はありません" You do not have any holds or recalls placed = "予約または返却請求された資料はありません" You do not have any interlibrary loan requests placed = "ILLリクエストはありません。" diff --git a/languages/mn.ini b/languages/mn.ini index 2dab3fae8bb..9d5c7f88f26 100644 --- a/languages/mn.ini +++ b/languages/mn.ini @@ -996,7 +996,7 @@ password_minimum_length = "Нууц үгийн доод урт %%minlength%% т password_only_alphanumeric = "Зөвхөн тоо болон A-Z хүртэлх үсэг" password_only_numeric = "Зөвхөн тоонууд" Passwords do not match = "Нууц үг таарахгүй байна" -past_days = "Өмнөх %%range%% хоногууд" +past_days = "{range, plural, =1 {Өчигдөр} other {Өмнөх # хоногууд}}" patron_account_expires = "Хугацаа дуусна" patron_status_address_missing = "Таны хаяг байхгүй байна." patron_status_card_blocked = "Энэхүү номын сангийн картаар түрээслэж авахыг хориглосон байна." @@ -1449,7 +1449,6 @@ widen_prefix = "Хайлтаа руу өргөжүүлээд үзээрэй" wiki_link = "Wikipedia-аас ирүүлсэн" with filters = "шүүлтүүртэй" Year of Publication = "Хэвлэсэн он" -Yesterday = "Өчигдөр" You do not have any fines = "Танд ямар ч торгууль байхгүй байна" You do not have any holds or recalls placed = "Танд түр хойшлуулсан эсвэл буцааж татсан зүйл байхгүй байна" You do not have any interlibrary loan requests placed = "Та номын сан хоорондын түрээсийн хүсэлт ирүүлээгүй байна" diff --git a/languages/nl.ini b/languages/nl.ini index 8289b36f6b1..db07a30e72a 100644 --- a/languages/nl.ini +++ b/languages/nl.ini @@ -925,7 +925,7 @@ password_minimum_length = "Het wachtwoord bevat minimaal %%minlength%% karakters password_only_alphanumeric = "Enkel nummers en letters A-Z" password_only_numeric = "Enkel nummers" Passwords do not match = "Wachtwoorden komen niet overeen" -past_days = "Vorige %%range%% Dagen" +past_days = "{range, plural, =1 {Gisteren} other {Vorige # Dagen}}" patron_account_expires = "Loopt af op" patron_status_address_missing = "Je adres ontbreekt" patron_status_card_blocked = "Deze bibliotheekkaart is geblokkeerd voor het ontlenen van materialen." @@ -1322,7 +1322,6 @@ widen_prefix = "Probeer jouw zoekopdracht te verbreden naar" wiki_link = "Door Wikipedia aangeleverd" with filters = "met filters" Year of Publication = "Publicatiejaar" -Yesterday = "Gisteren" You do not have any fines = "Je hebt geen boetes uitstaan" You do not have any holds or recalls placed = "Je hebt geen Verzoeken tot vasthouden of Reserveringen" You do not have any interlibrary loan requests placed = "Je hebt geen IBL aanvragen lopen" diff --git a/languages/pl.ini b/languages/pl.ini index a680a9a2c2f..9061b7ec94f 100644 --- a/languages/pl.ini +++ b/languages/pl.ini @@ -986,7 +986,7 @@ password_minimum_length = "Minimalna długość hasła to %%minlength%% znaków" password_only_alphanumeric = "Tylko numery oraz literki A-Z" password_only_numeric = "Tylko numery" Passwords do not match = "Hasła nie są identyczne" -past_days = "od %%range%% Dni" +past_days = "{range, plural, =1 {Wczoraj} other {od # Dni}}" patron_account_expires = "Termin zwrotu" patron_status_address_missing = "Brakuje twojego adresu." patron_status_card_blocked = "Twoje konto czytelnika nie ma możeliwości wypożyczania." @@ -1383,7 +1383,6 @@ widen_prefix = "Rozszerz wyszukiwanie o" wiki_link = "Źródło: Wikipedia" with filters = "z filtrami" Year of Publication = "Rok wydania" -Yesterday = "Wczoraj" You do not have any fines = "Nie masz opłat na twoim koncie" You do not have any holds or recalls placed = "Nie masz zamówień" You do not have any interlibrary loan requests placed = "Nie masz zamówień międzybibliotecznych" diff --git a/languages/pt-br.ini b/languages/pt-br.ini index a37d348bde0..37851413bda 100644 --- a/languages/pt-br.ini +++ b/languages/pt-br.ini @@ -999,7 +999,7 @@ password_minimum_length = "O tamanho mínimo da senha é %%minlength%% caractere password_only_alphanumeric = "Use somente números e letras de a até z" password_only_numeric = "Somente números" Passwords do not match = "As senhas não coincidem." -past_days = "Últimos %%range%% Dias" +past_days = "{range, plural, =1 {Ontem} other {Últimos # Dias}}" patron_account_expires = "Expira" patron_status_address_missing = "Seu endereço está ausente." patron_status_card_blocked = "Este cartão de biblioteca está bloqueado para empréstimo." @@ -1452,7 +1452,6 @@ widen_prefix = "Tente ampliar a sua busca a" wiki_link = "Fornecido pela Wikipedia" with filters = "com os filtros" Year of Publication = "Ano de Publicação" -Yesterday = "Ontem" You do not have any fines = "Você não tem quaisquer multas" You do not have any holds or recalls placed = "Você não tem qualquer reserva ou pedidos de devolução" You do not have any interlibrary loan requests placed = "Você não tem quaisquer pedidos de empréstimo entre interbibliotecas" diff --git a/languages/pt.ini b/languages/pt.ini index 0a2a0155555..981100e295a 100644 --- a/languages/pt.ini +++ b/languages/pt.ini @@ -677,7 +677,7 @@ password_error_not_unique = "A senha não foi alterada" password_maximum_length = "O comprimento máximo da senha é %%maxlength%% caractéres" password_minimum_length = "Tamanho mínimo da senha é %%minlength%% caractéres" Passwords do not match = "As senhas não coincidem." -past_days = "Últimos %%range%% Dias" +past_days = "{range, plural, =1 {Ontem} other {Últimos # Dias}}" patron_account_expires = "Expira" PDF Full Text = "Texto integral em PDF" peer_reviewed = "Revisto por pares" @@ -994,7 +994,6 @@ widen_prefix = "Tente alargar a sua pesquisa a" wiki_link = "Fornecido pela Wikipedia" with filters = "com os filtros" Year of Publication = "Ano de Publicação" -Yesterday = "Ontem" You do not have any fines = "Você não tem quaisquer multas" You do not have any holds or recalls placed = "Você não tem qualquer reserva ou pedidos colocados" You do not have any interlibrary loan requests placed = "Você não tem quaisquer pedidos de empréstimo interbibliotecas" diff --git a/languages/ru.ini b/languages/ru.ini index 7c3a7dc7433..a57b41f593a 100644 --- a/languages/ru.ini +++ b/languages/ru.ini @@ -1016,7 +1016,7 @@ password_minimum_length = "Минимальная длина пароля - %%mi password_only_alphanumeric = "Только цифры и буквы от A до Z" password_only_numeric = "Только цифры" Passwords do not match = "Несоответствие паролей" -past_days = "Прошедшие %%range%% дней" +past_days = "{range, plural, =1 {Вчера} other {Прошедшие # дней}}" patron_account_expires = "Исчерпано" patron_status_address_missing = "Ваш адрес отсутствует." patron_status_card_blocked = "Этот читательский билет заблокирован для заимствования." @@ -1469,7 +1469,6 @@ widen_prefix = "Попытайтесь расширить свой поиск" wiki_link = "Предоставлено Wikipedia" with filters = "с фильтрами" Year of Publication = "Дата издания" -Yesterday = "Вчера" You do not have any fines = "У Вас нет штафов" You do not have any holds or recalls placed = "У пользователя не должно быть никаких задолженностей или напоминаний" You do not have any interlibrary loan requests placed = "Вы не задали ни один межбиблиотечный запрос" diff --git a/languages/se.ini b/languages/se.ini index e7161d240a3..05a6d2dffb5 100644 --- a/languages/se.ini +++ b/languages/se.ini @@ -914,7 +914,7 @@ password_minimum_length = "Beassansáni unnimusguhkkodat lea %%minlength%% meark password_only_alphanumeric = "Dušše nummárat ja bustávat a-z" password_only_numeric = "Dušše nummárat" Passwords do not match = "Beassansánit eai stemme" -past_days = "Maŋemus %%range%% beaivvi" +past_days = "{range, plural, =1 {Ievttážis} other {Maŋemus # beaivvi}}" patron_account_expires = "Boarásnuvvá" patron_status_address_missing = "Du čujuhusdieđut leat váilevaččat." patron_status_card_blocked = "Du girjerádjogoartta lea luoikkahangielddus." @@ -1304,7 +1304,6 @@ widen_prefix = "Geahččal viiddidit ohcama:" wiki_link = "Wikipedia buvttadan" with filters = "filteriiguin" Year of Publication = "Almmustuhttinjahki" -Yesterday = "Ievttážis" You do not have any fines = "Eai mávssekeahtes mávssut" You do not have any holds or recalls placed = "Eai gustojeaddji várremat" You do not have any interlibrary loan requests placed = "Ii gustojeaddji gáiddusluoikkahandiŋgojumit" diff --git a/languages/sl.ini b/languages/sl.ini index 3be5aac34d1..b7f7f5ce4c3 100644 --- a/languages/sl.ini +++ b/languages/sl.ini @@ -577,7 +577,7 @@ Password = "Geslo" Password Again = "Ponovite geslo" Password cannot be blank = "Vpišite geslo" Passwords do not match = "Geslo se ne ujema" -past_days = "Preteklo %%range%% Dnevi" +past_days = "{range, plural, =1 {Včeraj} other {Preteklo # Dnevi}}" patron_account_expires = "poteče" peer_reviewed_limit = "Omejite na članke iz peer-reviewed revij" Phone Number = "Telefonska številka" @@ -825,7 +825,6 @@ widen_prefix = "Poizkusite razširiti vaše iskanje" wiki_link = "V Wikipediji" with filters = "s filtri" Year of Publication = "Leto izdaje" -Yesterday = "Včeraj" You do not have any fines = "Nimate zamudnin" You do not have any holds or recalls placed = "Nimate izposojenih in rezerviranih" You do not have any items checked out = "Nimate ničesar izposojenega" diff --git a/languages/sv.ini b/languages/sv.ini index 6b9f6b6d049..fb83db452e3 100644 --- a/languages/sv.ini +++ b/languages/sv.ini @@ -998,7 +998,7 @@ password_minimum_length = "Minsta längd på lösenord är %%minlength%% tecken" password_only_alphanumeric = "Bara siffror och bokstäver a-z" password_only_numeric = "Bara siffror" Passwords do not match = "Lösenorden stämmer inte" -past_days = "Senaste %%range%% Dagar" +past_days = "{range, plural, =1 {Från igår} other {Senaste # Dagar}}" patron_account_expires = "Förfaller" patron_status_address_missing = "Din adress saknas." patron_status_card_blocked = "Du har låneförbud." @@ -1451,7 +1451,6 @@ widen_prefix = "Pröva att utvidga sökningen:" wiki_link = "Levererad av Wikipedia" with filters = "med filter" Year of Publication = "Utgivningsår" -Yesterday = "Från igår" You do not have any fines = "Du har inga obetalda avgifter" You do not have any holds or recalls placed = "Du har inga reserveringar i kraft" You do not have any interlibrary loan requests placed = "Du har inga fjärrlånbeställningar i kraft" diff --git a/languages/tr.ini b/languages/tr.ini index 75e58e5fbae..396d8757bfe 100644 --- a/languages/tr.ini +++ b/languages/tr.ini @@ -1053,7 +1053,7 @@ password_minimum_length = "Minimum şifre uzunluğu %%minlength%% karakter" password_only_alphanumeric = "Sayılar ve Harfler Sadece A-Z" password_only_numeric = "Sadece Sayılar" Passwords do not match = "Şifre eşleşmedi" -past_days = "Geçen %%range%% Gün" +past_days = "{range, plural, =1 {Dün} other {Geçen # Gün}}" patron_account_expires = "Bitiş Tarihi" patron_status_address_missing = "Adresiniz Eksik." patron_status_card_blocked = "Bu kütüphane kartının ödünç alması engellendi." @@ -1506,7 +1506,6 @@ widen_prefix = "Aramanızı genişletmeyi deneyin." wiki_link = "Yukarıdaki bilgiler Wikipedia'dan alınmıştır" with filters = "Filitreleme" Year of Publication = "Yayın Tarihi" -Yesterday = "Dün" You do not have any fines = "Geçikme cezanız yoktur" You do not have any holds or recalls placed = "Rezerve etiğiniz kayıt bulunmamaktadır" You do not have any interlibrary loan requests placed = "Herhangi bir kütüphaneler arası istekte bulunmadınız" diff --git a/languages/uk.ini b/languages/uk.ini index c2326d6171e..87c843462f3 100644 --- a/languages/uk.ini +++ b/languages/uk.ini @@ -999,7 +999,7 @@ password_minimum_length = "Мінімальна довжина пароля - %% password_only_alphanumeric = "Лише числа та літери A-Z" password_only_numeric = "Лише числа" Passwords do not match = "Паролі не співпадають" -past_days = "Минуло %%range%% днів" +past_days = "{range, plural, =1 {Вчора} other {Минуло # днів}}" patron_account_expires = "Термін дії закінчується" patron_status_address_missing = "Відсутня адреса." patron_status_card_blocked = "Цей читацький формуляр заблокований для видач." @@ -1452,7 +1452,6 @@ widen_prefix = "Спробуйте розширити Ваш пошук до" wiki_link = "Надано: Wikipedia" with filters = "з фільтрами" Year of Publication = "Рік видання" -Yesterday = "Вчора" You do not have any fines = "Ви не маєте пені" You do not have any holds or recalls placed = "Ви не маєте замовлень та відкликів" You do not have any interlibrary loan requests placed = "Ви не маєте замовлень МБА" diff --git a/languages/vi.ini b/languages/vi.ini index 56e449cecdb..1de64e6f453 100644 --- a/languages/vi.ini +++ b/languages/vi.ini @@ -922,7 +922,7 @@ password_minimum_length = "Độ dài mật khẩu tối thiểu là %%minlength password_only_alphanumeric = "Chỉ số và chữ cái A-Z" password_only_numeric = "Chỉ số" Passwords do not match = "Mật khẩu không đúng" -past_days = "%%range%% ngày trước" +past_days = "{range, plural, =1 {Hôm qua} other {# ngày trước}}" patron_account_expires = "Hết hạn" patron_status_address_missing = "Địa chỉ của bạn bị thiếu." patron_status_card_blocked = "Thẻ thư viện này bị chặn mượn." @@ -1316,7 +1316,6 @@ widen_prefix = "Thử mở rộng tìm kiếm của bạn thành" wiki_link = "Được cung cấp bởi Wikipedia" with filters = "với bộ lọc" Year of Publication = "Năm xuất bản" -Yesterday = "Hôm qua" You do not have any fines = "Bạn không có tiền phạt nào" You do not have any holds or recalls placed = "Bạn không có bất kỳ lệnh giữ hoặc lệnh gọi lại nào được đặt" You do not have any interlibrary loan requests placed = "Bạn không có bất kỳ yêu cầu mượn liên thư viện nào được đặt" diff --git a/languages/zh-cn.ini b/languages/zh-cn.ini index 5ec63296481..129686c3a20 100644 --- a/languages/zh-cn.ini +++ b/languages/zh-cn.ini @@ -593,7 +593,7 @@ Password = "密码" Password Again = "确认密码" Password cannot be blank = "密码不能是空的" Passwords do not match = "密码不匹配" -past_days = "过去 %%range%% 天" +past_days = "{range, plural, =1 {昨天} other {过去 # 天}}" patron_account_expires = "过期" peer_reviewed_limit = "只限制同行评审期刊文章" Phone Number = "电话号码" @@ -790,7 +790,6 @@ Web = "网站" wiki_link = "维基百科提供" with filters = "带过滤器" Year of Publication = "出版年" -Yesterday = "昨天" You do not have any fines = "您没有任何罚款" You do not have any holds or recalls placed = "您没有预约或召回任何图书" You do not have any items checked out = "您没有借任何图书" diff --git a/languages/zh.ini b/languages/zh.ini index 0ada8f31870..bfe4b1f8fff 100644 --- a/languages/zh.ini +++ b/languages/zh.ini @@ -459,7 +459,7 @@ Password = "密碼" Password Again = "確認密碼" Password cannot be blank = "密碼不能是空的" Passwords do not match = "密碼不匹配" -past_days = "過去 %%range%% 天" +past_days = "{range, plural, =1 {昨天} other {過去 # 天}}" patron_account_expires = "過期" peer_reviewed_limit = "只限制同行評審期刊文章" Phone Number = "電話號碼" @@ -656,7 +656,6 @@ Web = "網站" wiki_link = "維基百科提供" with filters = "帶過濾器" Year of Publication = "出版年" -Yesterday = "昨天" You do not have any fines = "您沒有任何罰款" You do not have any holds or recalls placed = "您沒有預約或召回任何圖書" You do not have any items checked out = "您沒有借任何圖書" diff --git a/module/VuFind/src/VuFind/I18n/Translator/TranslatorAwareTrait.php b/module/VuFind/src/VuFind/I18n/Translator/TranslatorAwareTrait.php index be760e6207f..d5c114bb795 100644 --- a/module/VuFind/src/VuFind/I18n/Translator/TranslatorAwareTrait.php +++ b/module/VuFind/src/VuFind/I18n/Translator/TranslatorAwareTrait.php @@ -95,16 +95,17 @@ public function getTranslatorLocale($default = 'en') /** * Translate a string (or string-castable object) * - * @param string|object|array $target String to translate or an array of text - * domain and string to translate - * @param array $tokens Tokens to inject into the translated - * string - * @param string $default Default value to use if no translation is - * found (null for no default). + * @param string|object|array $target String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ - public function translate($target, $tokens = [], $default = null) + public function translate($target, $tokens = [], $default = null, $useIcuFormatter = false) { // Figure out the text domain for the string: [$domain, $str] = $this->extractTextDomain($target); @@ -130,7 +131,7 @@ public function translate($target, $tokens = [], $default = null) // On this pass, don't use the $default, since we want to fail over // to getDisplayString before giving up: $translated = $this - ->translateString((string)$str, $tokens, null, $domain); + ->translateString((string)$str, $tokens, null, $domain, $useIcuFormatter); if ($translated !== (string)$str) { return $translated; } @@ -142,27 +143,28 @@ public function translate($target, $tokens = [], $default = null) // least with hierarchical facets where translation key can be the exact // facet value (e.g. "0/Book/") or a displayable value (e.g. "Book"). if ($str instanceof \VuFind\I18n\TranslatableStringInterface) { - return $this->translate($str, $tokens, $default); + return $this->translate($str, $tokens, $default, $useIcuFormatter); } else { [$domain, $str] = $this->extractTextDomain($str); } } // Default case: deal with ordinary strings (or string-castable objects): - return $this->translateString((string)$str, $tokens, $default, $domain); + return $this->translateString((string)$str, $tokens, $default, $domain, $useIcuFormatter); } /** * Translate a string (or string-castable object) using a prefix, or without the * prefix if a prefixed translation is not found. * - * @param string $prefix Translation key prefix - * @param string|object|array $target String to translate or an array of text - * domain and string to translate - * @param array $tokens Tokens to inject into the translated - * string - * @param string $default Default value to use if no translation is - * found (null for no default). + * @param string $prefix Translation key prefix + * @param string|object|array $target String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ @@ -170,7 +172,8 @@ public function translateWithPrefix( $prefix, $target, $tokens = [], - $default = null + $default = null, + $useIcuFormatter = false ) { if (is_string($target)) { if (null === $default) { @@ -178,17 +181,19 @@ public function translateWithPrefix( } $target = $prefix . $target; } - return $this->translate($target, $tokens, $default); + return $this->translate($target, $tokens, $default, $useIcuFormatter); } /** * Get translation for a string * - * @param string $str String to translate - * @param array $tokens Tokens to inject into the translated string - * @param string $default Default value to use if no translation is found - * (null for no default). - * @param string $domain Text domain (omit for default) + * @param string $str String to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is found + * (null for no default). + * @param string $domain Text domain (omit for default) + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ @@ -196,7 +201,8 @@ protected function translateString( $str, $tokens = [], $default = null, - $domain = 'default' + $domain = 'default', + $useIcuFormatter = false ) { $msg = (null === $this->translator) ? $str : $this->translator->translate($str, $domain); @@ -209,6 +215,9 @@ protected function translateString( // Do we need to perform substitutions? if (!empty($tokens)) { + if ($useIcuFormatter) { + return \MessageFormatter::formatMessage($this->getTranslatorLocale(), $msg, $tokens); + } $in = $out = []; foreach ($tokens as $key => $value) { $in[] = $key; diff --git a/module/VuFind/src/VuFind/View/Helper/Root/TransEsc.php b/module/VuFind/src/VuFind/View/Helper/Root/TransEsc.php index f119cd04129..149de152da3 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/TransEsc.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/TransEsc.php @@ -45,17 +45,20 @@ class TransEsc extends AbstractHelper /** * Translate and escape a string * - * @param string $str String to escape and translate - * @param array $tokens Tokens to inject into the translated string - * @param string $default Default value to use if no translation is found (null - * for no default). + * @param string|object|array $str String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ - public function __invoke($str, $tokens = [], $default = null) + public function __invoke($str, $tokens = [], $default = null, $useIcuFormatter = false) { $escaper = $this->getView()->plugin('escapeHtml'); $translator = $this->getView()->plugin('translate'); - return $escaper($translator($str, $tokens, $default)); + return $escaper($translator($str, $tokens, $default, $useIcuFormatter)); } } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php b/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php index 2bf661eb3e7..e2e847ba494 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php @@ -48,17 +48,20 @@ class TransEscAttr extends AbstractHelper /** * Translate and escape a string for an HTML attribute * - * @param string $str String to escape and translate - * @param array $tokens Tokens to inject into the translated string - * @param string $default Default value to use if no translation is found (null - * for no default). + * @param string|object|array $str String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ - public function __invoke($str, $tokens = [], $default = null) + public function __invoke($str, $tokens = [], $default = null, $useIcuFormatter = false) { $escaper = $this->getView()->plugin('escapeHtmlAttr'); $translator = $this->getView()->plugin('translate'); - return $escaper($translator($str, $tokens, $default)); + return $escaper($translator($str, $tokens, $default, $useIcuFormatter)); } } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/TransEscWithPrefix.php b/module/VuFind/src/VuFind/View/Helper/Root/TransEscWithPrefix.php index b49241afe21..fb8a5c398f6 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/TransEscWithPrefix.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/TransEscWithPrefix.php @@ -51,21 +51,24 @@ class TransEscWithPrefix extends AbstractHelper implements TranslatorAwareInterf use \VuFind\I18n\Translator\TranslatorAwareTrait; /** - * Translate and escape a location + * Translate and escape a value while applying a prefix * - * @param string $prefix Translation key prefix - * @param string|object $str String to translate - * @param array $tokens Tokens to inject into the translated string - * @param string $default Default value to use if no translation is found - * (null for no default). + * @param string $prefix Translation key prefix + * @param string|object|array $str String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ - public function __invoke($prefix, $str, $tokens = [], $default = null) + public function __invoke($prefix, $str, $tokens = [], $default = null, $useIcuFormatter = false) { $escaper = $this->getView()->plugin('escapeHtml'); return $escaper( - $this->translateWithPrefix($prefix, $str, $tokens, $default) + $this->translateWithPrefix($prefix, $str, $tokens, $default, $useIcuFormatter) ); } } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Translate.php b/module/VuFind/src/VuFind/View/Helper/Root/Translate.php index 910acb8893c..c7e4507bf11 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Translate.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Translate.php @@ -45,15 +45,18 @@ class Translate extends \Laminas\View\Helper\AbstractHelper implements \VuFind\I /** * Translate a string * - * @param string|object $str String to translate - * @param array $tokens Tokens to inject into the translated string - * @param string $default Default value to use if no translation is found - * (null for no default). + * @param string|object|array $str String to translate or an array of text + * domain and string to translate + * @param array $tokens Tokens to inject into the translated string + * @param string $default Default value to use if no translation is + * found (null for no default). + * @param bool $useIcuFormatter Should we use an ICU message formatter instead + * of the default behavior? * * @return string */ - public function __invoke($str, $tokens = [], $default = null) + public function __invoke($str, $tokens = [], $default = null, $useIcuFormatter = false) { - return $this->translate($str, $tokens, $default); + return $this->translate($str, $tokens, $default, $useIcuFormatter); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php index c7da969613f..deaebd4966a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php @@ -51,7 +51,7 @@ class TranslateTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function testTranslateWithoutTranslator() + public function testTranslateWithoutTranslator(): void { $translate = new Translate(); // Simple case that tests default values and tokens in a single pass: @@ -70,7 +70,7 @@ public function testTranslateWithoutTranslator() * * @return void */ - public function testTranslateWithEmptyArray() + public function testTranslateWithEmptyArray(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('Unexpected value sent to translator!'); @@ -84,7 +84,7 @@ public function testTranslateWithEmptyArray() * * @return void */ - public function testTranslateWithOverfilledArray() + public function testTranslateWithOverfilledArray(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('Unexpected value sent to translator!'); @@ -98,7 +98,7 @@ public function testTranslateWithOverfilledArray() * * @return void */ - public function testTranslateWithTranslator() + public function testTranslateWithTranslator(): void { $translate = new Translate(); $translate->setTranslator( @@ -155,7 +155,7 @@ public function testTranslateWithTranslator() * * @return void */ - public function testTranslateTranslatableStringDefaultValues() + public function testTranslateTranslatableStringDefaultValues(): void { $translate = new Translate(); $translate->setTranslator( @@ -174,7 +174,7 @@ public function testTranslateTranslatableStringDefaultValues() * * @return void */ - public function testTranslateTranslatableStringWithTranslator() + public function testTranslateTranslatableStringWithTranslator(): void { $translate = new Translate(); $translate->setTranslator( @@ -247,7 +247,7 @@ public function testTranslateTranslatableStringWithTranslator() * * @return void */ - public function testTranslateTranslatableStringAndTextDomainsWithTranslator() + public function testTranslateTranslatableStringAndTextDomainsWithTranslator(): void { $translate = new Translate(); $translate->setTranslator( @@ -314,7 +314,7 @@ public function testTranslateTranslatableStringAndTextDomainsWithTranslator() * * @return void */ - public function testTranslateTextDomainWithTranslator() + public function testTranslateTextDomainWithTranslator(): void { $translate = new Translate(); $translate->setTranslator( @@ -347,7 +347,7 @@ public function testTranslateTextDomainWithTranslator() * * @return void */ - public function testTranslateNestedTextDomainWithConflict() + public function testTranslateNestedTextDomainWithConflict(): void { $translations = [ 'd1' => ['foo' => 'bar', 'failure' => 'success'], @@ -369,7 +369,7 @@ public function testTranslateNestedTextDomainWithConflict() * * @return void */ - public function testLocaleWithoutTranslator() + public function testLocaleWithoutTranslator(): void { $translate = new Translate(); $this->assertEquals('foo', $translate->getTranslatorLocale('foo')); @@ -380,7 +380,7 @@ public function testLocaleWithoutTranslator() * * @return void */ - public function testLocaleWithTranslator() + public function testLocaleWithTranslator(): void { $translate = new Translate(); $translator = $this->createMock(\Laminas\I18n\Translator\Translator::class); @@ -395,11 +395,43 @@ public function testLocaleWithTranslator() * * @return void */ - public function testGetTranslator() + public function testGetTranslator(): void { $translate = new Translate(); $translator = $this->createMock(\Laminas\I18n\Translator\TranslatorInterface::class); $translate->setTranslator($translator); $this->assertEquals($translator, $translate->getTranslator()); } + + /** + * Test ICU translation with a translator object. + * + * @return void + */ + public function testIcuMessageTranslation(): void + { + $translate = new Translate(); + $translate->setTranslator( + $this->getMockTranslator(['default' => ['foo' => '{bar, plural, =1 {one} other {many = #}}']]) + ); + + $this->assertEquals( + 'one', + $translate( + 'foo', + ['bar' => '1'], + 'failure', + true + ) + ); + $this->assertEquals( + 'many = 7', + $translate( + 'foo', + ['bar' => '7'], + 'failure', + true + ) + ); + } } diff --git a/themes/bootstrap3/templates/search/newitem.phtml b/themes/bootstrap3/templates/search/newitem.phtml index 4a3954c10d1..a8d933c73a4 100644 --- a/themes/bootstrap3/templates/search/newitem.phtml +++ b/themes/bootstrap3/templates/search/newitem.phtml @@ -19,7 +19,7 @@ ranges as $key => $range): ?>