Skip to content

Commit

Permalink
adjust italian moustache translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaxeer committed Jul 9, 2024
1 parent 4f10a30 commit 5d5b372
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions modular_bandastation/translations/code/moustache.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,12 @@
name = "итальянские усы"
desc = "Изготовлен из настоящих итальянских волосков для усов. Дает владельцу непреодолимое желание дико жестикулировать."

/obj/item/clothing/mask/fakemoustache/italian/handle_speech(datum/source, list/speech_args)
var/message = speech_args[SPEECH_MESSAGE]
if(message[1] != "*")
var/static/regex/words = new(@"(?<![a-zA-Zа-яёА-ЯЁ])[a-zA-Zа-яёА-ЯЁ]+?(?![a-zA-Zа-яёА-ЯЁ])", "g")
message = replacetext(message, words, GLOBAL_PROC_REF(italian_words_replace))

if(prob(5))
message += pick(" Равиоли, равиоли, подскажи мне формуоли!"," Мамма-мия!"," Мамма-мия! Какая острая фрикаделька!", " Ла ла ла ла ла фуникули+ фуникуля+!", " Вордс Реплаке!")
speech_args[SPEECH_MESSAGE] = trim(message)

/proc/italian_words_replace(word)
var/static/list/italian_words
if(!italian_words)
italian_words = strings("italian_replacement_ru.json", "italian")

var/match = italian_words[lowertext(word)]
if(!match)
return word

if(islist(match))
match = pick(match)

if(word == uppertext(word))
return uppertext(match)

if(word == capitalize(word))
return capitalize(match)

return match
/obj/item/clothing/mask/fakemoustache/italian/Initialize(mapload)
. = ..()
AddComponent(\
/datum/component/speechmod,\
replacements = strings("italian_replacement_ru.json", "italian"),\
end_string = list(" Равиоли, равиоли, подскажи мне формуоли!"," Мамма-мия!"," Мамма-мия! Какая острая фрикаделька!", " Ла ла ла ла ла фуникули+ фуникуля+!"),\
end_string_chance = 3,\
slots = ITEM_SLOT_MASK\
)

0 comments on commit 5d5b372

Please sign in to comment.