mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Translation update, updating inline div tags and placeHolder attributes
This commit is contained in:
@@ -25,12 +25,8 @@ const translations = getTranslations();
|
||||
export default function translate(key, args = '') {
|
||||
if (args) {
|
||||
const translatedKey = translate(key);
|
||||
return translatedKey.replace(/(\{\{\d\}\}|\{\d\})/g, (translatedKeyDbl) => {
|
||||
if (translatedKeyDbl.substring(0, 2) === '{{') {
|
||||
return translatedKeyDbl;
|
||||
}
|
||||
const match = parseInt(translatedKey.match(/\d/)[0]);
|
||||
return args[match];
|
||||
return translatedKey.replace(/\{(\d+)\}/g, (match, index) => {
|
||||
return args[index];
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user