Skip to content

Commit

Permalink
Craft menu translate (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
larentoun authored Jul 12, 2024
1 parent 93e6fcf commit fe2477e
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 52 deletions.
42 changes: 21 additions & 21 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ DEFINE_BITFIELD(foodtypes, list(

/// IC meaning (more or less) for food flags
#define FOOD_FLAGS_IC list( \
"Meat", \
"Vegetables", \
"Raw food", \
"Junk food", \
"Grain", \
"Fruits", \
"Dairy products", \
"Fried food", \
"Alcohol", \
"Sugary food", \
"Gross food", \
"Toxic food", \
"Pineapples", \
"Breakfast food", \
"Clothing", \
"Nuts", \
"Seafood", \
"Oranges", \
"Bugs", \
"Gore", \
"Rocks", \
"Мясное", \
"Овощи", \
"Сырое", \
"Фастфуд", \
"Зерновое", \
"Фрукты", \
"Молочное", \
"Жареное", \
"Алкоголь", \
"Сахарное", \
"Ужасное", \
"Токсичное", \
"Ананасы", \
"Завтраки", \
"Из одежды", \
"Орехи", \
"Морепродукты", \
"Апельсины", \
"Из жуков", \
"Месиво", \
"Каменное", \
)

#define DRINK_REVOLTING 1
Expand Down
6 changes: 3 additions & 3 deletions code/datums/quirks/negative_quirks/allergic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
allergy_chem_names += initial(chem_type.name)

allergy_string = allergy_chem_names.Join(", ")
name = "Экстремальная аллергия на: [allergy_string]"
medical_record_text = "Иммунная система пациента бурно реагирует на [allergy_string]"
name = "Экстремальная аллергия на: <b>[LOWER_TEXT(allergy_string)]</b>"
medical_record_text = "Иммунная система пациента бурно реагирует на: <b>[LOWER_TEXT(allergy_string)]</b>"

var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/clothing/accessory/dogtag/allergy/dogtag = new(get_turf(human_holder), allergy_string)
Expand All @@ -42,7 +42,7 @@

/datum/quirk/item_quirk/allergic/post_add()
quirk_holder.add_mob_memory(/datum/memory/key/quirk_allergy, allergy_string = allergy_string)
to_chat(quirk_holder, span_boldnotice("У вас аллергия на [allergy_string], убедитесь, что вы не употребляете ничего из этого!"))
to_chat(quirk_holder, span_boldnotice("У вас аллергия на: <b>[LOWER_TEXT(allergy_string)]</b>. Убедитесь, что вы не употребляете ничего из этого!"))

/datum/quirk/item_quirk/allergic/process(seconds_per_tick)
if(!iscarbon(quirk_holder))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/food_allergy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(possible_food_allergies, list(

/datum/quirk/item_quirk/food_allergic/add_unique(client/client_source)
var/what_are_we_actually_killed_by = english_list(bitfield_to_list(target_foodtypes, FOOD_FLAGS_IC)) // This should never be more than one thing but just in case we can support it
to_chat(client_source.mob, span_info("У вас аллергия на [what_are_we_actually_killed_by]. Следите за тем, что вы едите!"))
to_chat(client_source.mob, span_info("У вас аллергия на: <b>[LOWER_TEXT(what_are_we_actually_killed_by)]</b>. Следите за тем, что вы едите!"))

var/obj/item/clothing/accessory/dogtag/allergy/dogtag = new(quirk_holder, what_are_we_actually_killed_by)
give_item_to_holder(dogtag, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS), flavour_text = "Держите его поблизости с кухней.")
123 changes: 96 additions & 27 deletions tgui/packages/tgui/interfaces/PersonalCrafting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,19 @@ export const PersonalCrafting = (props) => {
const CATEGORY_ICONS =
mode === MODE.cooking ? CATEGORY_ICONS_COOKING : CATEGORY_ICONS_CRAFTING;
return (
<Window width={700} height={720}>
<Window width={750} height={720}>
<Window.Content>
<Stack fill>
<Stack.Item width={'200px'}>
<Stack.Item width={'210px'}>
<Section fill>
<Stack fill vertical justify={'space-between'}>
<Stack.Item>
<Input
autoFocus
placeholder={
'Search in ' +
'Поиск в ' +
data.recipes.length +
(mode === MODE.cooking ? ' recipes...' : ' designs...')
(mode === MODE.cooking ? ' рецептах...' : ' чертежах...')
}
value={searchText}
onInput={(e, value) => {
Expand All @@ -279,7 +279,7 @@ export const PersonalCrafting = (props) => {
);
}}
>
Category
Категория
</Tabs.Tab>
{mode === MODE.cooking && (
<Tabs.Tab
Expand All @@ -297,7 +297,7 @@ export const PersonalCrafting = (props) => {
);
}}
>
Type
Тип
</Tabs.Tab>
)}
<Tabs.Tab
Expand All @@ -311,7 +311,7 @@ export const PersonalCrafting = (props) => {
setMaterial(material_occurences[0].atom_id);
}}
>
{mode === MODE.cooking ? 'Ingredient' : 'Material'}
{mode === MODE.cooking ? 'Ингредиент' : 'Материал'}
</Tabs.Tab>
</Tabs>
</Stack.Item>
Expand Down Expand Up @@ -405,7 +405,7 @@ export const PersonalCrafting = (props) => {
category === 'Blood Cult' ? 'red' : 'default'
}
>
{category}
{CATEGORY_NAMES[category] || category}
</Stack.Item>
{category === 'Can Make' && (
<Stack.Item>
Expand All @@ -422,15 +422,15 @@ export const PersonalCrafting = (props) => {
<Divider />
<Button.Checkbox
fluid
content="Can make only"
content="Можно сделать сейчас"
checked={display_craftable_only}
onClick={() => {
act('toggle_recipes');
}}
/>
<Button.Checkbox
fluid
content="Compact list"
content="Компактный список"
checked={display_compact}
onClick={() => act('toggle_compact')}
/>
Expand All @@ -442,7 +442,7 @@ export const PersonalCrafting = (props) => {
<Button.Checkbox
fluid
lineHeight={2}
content="Craft"
content="Создание"
checked={mode === MODE.crafting}
icon="hammer"
style={{
Expand All @@ -464,7 +464,7 @@ export const PersonalCrafting = (props) => {
<Button.Checkbox
fluid
lineHeight={2}
content="Cook"
content="Готовка"
checked={mode === MODE.cooking}
icon="utensils"
style={{
Expand Down Expand Up @@ -529,7 +529,7 @@ export const PersonalCrafting = (props) => {
</VirtualList>
) : (
<NoticeBox m={1} p={1}>
No recipes found.
Не найдены рецепты.
</NoticeBox>
)}
{recipes.length > displayLimit && (
Expand All @@ -539,8 +539,8 @@ export const PersonalCrafting = (props) => {
style={{ cursor: 'pointer' }}
onClick={() => setPages(pages + 1)}
>
Load {Math.min(pageSize, recipes.length - displayLimit)}{' '}
more...
Загрузить ещё{' '}
{Math.min(pageSize, recipes.length - displayLimit)}
</Section>
)}
</Box>
Expand Down Expand Up @@ -615,7 +615,7 @@ const FoodtypeContent = (props) => {
<Icon name={TYPE_ICONS[type] || 'circle'} />
</Stack.Item>
<Stack.Item grow style={{ textTransform: 'capitalize' }}>
{type.toLowerCase()}
{TYPE_NAMES[type] || type.toLowerCase()}
</Stack.Item>
<Stack.Item>
{type === 'Can Make'
Expand Down Expand Up @@ -693,7 +693,7 @@ const RecipeContentCompact = ({ item, craftable, busy, mode }) => {
<Box>
{!!item.tool_behaviors && (
<Tooltip
content={'Tools: ' + item.tool_behaviors.join(', ')}
content={'Инструменты: ' + item.tool_behaviors.join(', ')}
>
<Icon p={1} name="screwdriver-wrench" />
</Tooltip>
Expand All @@ -702,7 +702,7 @@ const RecipeContentCompact = ({ item, craftable, busy, mode }) => {
my={0.3}
lineHeight={2.5}
align="center"
content="Make"
content="Создать"
disabled={!craftable || busy}
icon={
busy
Expand All @@ -725,7 +725,7 @@ const RecipeContentCompact = ({ item, craftable, busy, mode }) => {
width={'32px'}
align="center"
tooltip={
'Repeat this craft until you run out of ingredients.'
'Продолжать создание, пока не закончатся ингредиенты.'
}
tooltipPosition={'top'}
disabled={!craftable || busy}
Expand Down Expand Up @@ -788,7 +788,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
<Box>
<GroupTitle
title={
mode === MODE.cooking ? 'Ingredients' : 'Materials'
mode === MODE.cooking ? 'Ингредиенты' : 'Материалы'
}
/>
{Object.keys(item.reqs).map((atom_id) => (
Expand All @@ -814,7 +814,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
)}
{(item.tool_paths || item.tool_behaviors) && (
<Box>
<GroupTitle title="Tools" />
<GroupTitle title="Инструменты" />
{item.tool_paths &&
item.tool_paths.map((tool) => (
<AtomContent key={tool} atom_id={tool} amount={1} />
Expand All @@ -827,15 +827,15 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
)}
{item.machinery && (
<Box>
<GroupTitle title="Machinery" />
<GroupTitle title="Машинерия" />
{item.machinery.map((atom_id) => (
<AtomContent key={atom_id} atom_id={atom_id} amount={1} />
))}
</Box>
)}
{item.structures && (
<Box>
<GroupTitle title="Structures" />
<GroupTitle title="Структуры" />
{item.structures.map((atom_id) => (
<AtomContent key={atom_id} atom_id={atom_id} amount={1} />
))}
Expand All @@ -844,7 +844,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
</Box>
{!!item.steps?.length && (
<Box>
<GroupTitle title="Steps" />
<GroupTitle title="Шаги" />
<ul style={{ paddingLeft: '20px' }}>
{item.steps.map((step) => (
<li key={step}>{step}</li>
Expand All @@ -862,7 +862,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
<Button
lineHeight={2.5}
align="center"
content="Make"
content="Создать"
fluid
disabled={!craftable || busy}
icon={
Expand All @@ -887,7 +887,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
lineHeight={2.5}
align="center"
tooltip={
'Repeat this craft until you run out of ingredients.'
'Продолжать создание, пока не закончатся ингредиенты.'
}
tooltipPosition={'top'}
disabled={!craftable || busy}
Expand All @@ -907,7 +907,7 @@ const RecipeContent = ({ item, craftable, busy, mode, diet }) => {
<Stack.Item>
{!!item.complexity && (
<Box color={'gray'} width={'104px'} lineHeight={1.5} mt={1}>
Complexity: {item.complexity}
Сложность: {item.complexity}
</Box>
)}
{item.foodtypes?.length > 0 && (
Expand Down Expand Up @@ -987,3 +987,72 @@ const GroupTitle = ({ title }) => {
</Stack>
) as any;
};

// BANDASTATION EDIT START
const TYPE_NAMES = {
'Can Make': 'Можно сделать',
[Food.Alcohol]: 'Алкоголь',
[Food.Breakfast]: 'Завтраки',
[Food.Bugs]: 'Из жуков',
[Food.Cloth]: 'Из одежды',
[Food.Dairy]: 'Молочное',
[Food.Fried]: 'Жареное',
[Food.Fruit]: 'Фрукты',
[Food.Gore]: 'Месиво',
[Food.Grain]: 'Зерновое',
[Food.Gross]: 'Ужасное',
[Food.Junkfood]: 'Фастфуд',
[Food.Meat]: 'Мясное',
[Food.Nuts]: 'Орехи',
[Food.Oranges]: 'Апельсины',
[Food.Pineapple]: 'Ананасы',
[Food.Raw]: 'Сырое',
[Food.Seafood]: 'Морепродукты',
[Food.Stone]: 'Каменное',
[Food.Sugar]: 'Сахарное',
[Food.Toxic]: 'Токсичное',
[Food.Vegetables]: 'Овощи',
} as const;

const CATEGORY_NAMES = {
'Can Make': 'Можно сделать',
'Weapons Melee': 'Оружие: холодное',
'Weapons Ranged': 'Оружие: дальнобойное',
'Weapon Ammo': 'Оружие: патроны',
Robotics: 'Робототехника',
Misc: 'Прочее',
Tribal: 'Племенное',
Clothing: 'Одежда',
Drinks: 'Напитки',
Chemistry: 'Химия',
Atmospherics: 'Атмосферика',
Structures: 'Структуры',
Tiles: 'Полы',
Windows: 'Окна',
Doors: 'Двери',
Furniture: 'Мебель',
Equipment: 'Снаряжение',
Containers: 'Контейнеры',
Tools: 'Инструменты',
Entertainment: 'Развлечения',
'Blood Cult': 'Культ крови',
Breads: 'Хлебобулочное',
Burgers: 'Бургеры',
Cakes: 'Торты',
'Egg-Based Food': 'На основе яиц',
Frozen: 'Замороженное',
'Lizard Food': 'Ящерская кухня',
Meats: 'Мясное',
'Mexican Food': 'Мексиканская кухня',
'Misc. Food': 'Прочее',
'Mothic Food': 'Молиная кухня',
Pastries: 'Кондитерские изделия',
Pies: 'Пироги',
Pizzas: 'Пиццы',
Salads: 'Салаты',
Sandwiches: 'Сэндвичи',
Seafood: 'Морепродукты',
Soups: 'Супы',
Spaghettis: 'Спагетти',
'Martian Food': 'Марсианская кухня',
};

0 comments on commit fe2477e

Please sign in to comment.