From e447ea1167d150058ce837b2f079d4e65f959770 Mon Sep 17 00:00:00 2001 From: Govindas Date: Thu, 13 Aug 2020 16:34:10 +0300 Subject: [PATCH] Simplify the logic of variables. "Simplicity is the biggest sophistication" - Leonardo da Vinci. --- code/!lang.sk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/!lang.sk b/code/!lang.sk index 32b61f8..817832f 100644 --- a/code/!lang.sk +++ b/code/!lang.sk @@ -77,10 +77,7 @@ function translate(m: text, p: object, variables: strings = "null") :: text: if {_variables::1} is not "null": set {_msg} to {langmsg::%{_lang}%::%{_m}%} loop {_variables::*}: - {_msg} contains "$%loop-index%$": - replace "$%loop-index%$" with loop-value in {_msg} - else: - exit loop + replace "$%loop-index%$" with loop-value in {_msg} return {_msg} #Translation Mode 1, return the message (MOST USEFUL!)