importtranslatefrom'translatr'vardictionary={key_1: "Prosze, dwa bilety drugiej klasy do Warszawy.",key_2: ["$count"," ",["godzina","godziny","godzin"]],key_3: {nested_1: 'Cześć!'nested_2: ["$count"," ",["godzina","godziny","godzin"]]}}varstring_1=translate(dictionary,'pl','key_1');// Prosze, dwa bilety drugiej klasy do Warszawy.varstring_2=translate(dictionary,'pl','key_2',1);// 1 godzinavarstring_3=translate(dictionary,'pl','key_2',3);// 3 godzinyvarstring_4=translate(dictionary,'pl','key_2',31);// 31 godzinvarstring_5=translate(dictionary,'pl','key_3.nested_1');// Cześć!varstring_6=translate(dictionary,'pl','key_3.nested_2',41);// 41 godzin
importtranslatefrom'translatr'vardictionary={key_1: "Ayant risqué une fois, on peut rester heureux toute la vie",key_2: ["$count"," ",["heure","heures"]],key_3: {nested_1: 'Bonjour!'nested_2: ["$count"," ",["heure","heures"]]}}varstring_1=translate(dictionary,'fr','key_1');// Ayant risqué une fois-on peut rester heureux toute la vievarstring_2=translate(dictionary,'fr','key_2',0);// 0 heurevarstring_3=translate(dictionary,'fr','key_2',1);// 1 heurevarstring_4=translate(dictionary,'fr','key_2',7);// 7 heuresvarstring_5=translate(dictionary,'en','key_3.nested_1');// Bonjour!varstring_6=translate(dictionary,'en','key_3.nested_2',3);// 5 heures