Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish i18n (mostly Sawbench UI) and update ru_RU.lang #83

Merged
merged 2 commits into from Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -30,6 +30,7 @@
import com.elytradev.architecture.common.tile.ContainerSawbench;
import com.elytradev.architecture.common.tile.TileSawbench;
import com.elytradev.architecture.legacy.base.BaseGui;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -87,7 +88,7 @@ protected void drawBackgroundLayer() {
this.drawShapeSelection();
this.drawPageMenu();
this.drawSelectedShapeTitle();
this.fontRenderer.drawString("Sawbench", 7, 7, 4210752);
this.fontRenderer.drawString(I18n.format("architecturecraft.gui.sawbench.title"), 7, 7, 4210752);
}

void drawPageMenu() {
Expand All @@ -98,7 +99,7 @@ void drawPageMenu() {
this.drawRect(0, this.te.selectedPage * pageMenuRowHeight, pageMenuWidth, pageMenuRowHeight);
this.gRestore();
for (int i = 0; i < TileSawbench.pages.length; i++) {
this.drawString(TileSawbench.pages[i].title, 1, 1);
this.drawString(TileSawbench.pages[i].getLocalizedName(), 1, 1);
glTranslatef(0, pageMenuRowHeight, 0);
}
glPopMatrix();
Expand Down Expand Up @@ -159,7 +160,7 @@ void drawSelectedShapeTitle() {
glPushMatrix();
glTranslatef(materialUsageLeft, materialUsageTop, 0);
glScalef(0.5f, 0.5f, 1.0f);
this.drawString(String.format("%s makes %s", this.te.materialMultiple(), this.te.resultMultiple()), 0, 0);
this.drawString(I18n.format("architecturecraft.gui.sawbench.ratio", this.te.materialMultiple(), this.te.resultMultiple()), 0, 0);
glPopMatrix();
}
}
Expand Down
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.color.BlockColors;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -113,7 +114,7 @@ public static String displayNameOfBlock(Block block, int meta) {
}
if (name == null)
name = block.getLocalizedName();
return "Cut from " + name;
return I18n.format("tooltip.architecturecraft.cutfrom", name);
}

public static String displayNameOnlyOfBlock(Block block, int meta) {
Expand Down
Expand Up @@ -24,13 +24,15 @@

package com.elytradev.architecture.common.shape;

import net.minecraft.client.resources.I18n;

public class ShapePage {

public String title;
public String translationKey;
public EnumShape[] shapes;

public ShapePage(String title, EnumShape... shapes) {
this.title = title;
public ShapePage(String translationKey, EnumShape... shapes) {
this.translationKey = translationKey;
this.shapes = shapes;
}

Expand All @@ -44,4 +46,8 @@ public EnumShape get(int i) {
return null;
}

public String getLocalizedName() {
return I18n.format(this.translationKey);
}

}
Expand Up @@ -48,32 +48,32 @@ public class TileSawbench extends TileArchitectureInventory {
public static boolean allowAutomation = false;

public static ShapePage[] pages = {
new ShapePage("Roofing",
new ShapePage("architecturecraft.shapepage.roofing",
EnumShape.ROOF_TILE, EnumShape.ROOF_OUTER_CORNER, EnumShape.ROOF_INNER_CORNER,
EnumShape.ROOF_RIDGE, EnumShape.ROOF_SMART_RIDGE, EnumShape.ROOF_VALLEY,
EnumShape.ROOF_SMART_VALLEY, EnumShape.ROOF_OVERHANG, EnumShape.ROOF_OVERHANG_OUTER_CORNER,
EnumShape.ROOF_OVERHANG_INNER_CORNER, EnumShape.ROOF_OVERHANG_GABLE_LH, EnumShape.ROOF_OVERHANG_GABLE_RH,
EnumShape.ROOF_OVERHANG_GABLE_END_LH, EnumShape.ROOF_OVERHANG_GABLE_END_RH, EnumShape.ROOF_OVERHANG_RIDGE,
EnumShape.ROOF_OVERHANG_VALLEY, EnumShape.BEVELLED_OUTER_CORNER, EnumShape.BEVELLED_INNER_CORNER),
new ShapePage("Rounded",
new ShapePage("architecturecraft.shapepage.rounded",
EnumShape.CYLINDER, EnumShape.CYLINDER_HALF, EnumShape.CYLINDER_QUARTER, EnumShape.CYLINDER_LARGE_QUARTER, EnumShape.ANTICYLINDER_LARGE_QUARTER,
EnumShape.PILLAR, EnumShape.POST, EnumShape.POLE, EnumShape.SPHERE_FULL, EnumShape.SPHERE_HALF,
EnumShape.SPHERE_QUARTER, EnumShape.SPHERE_EIGHTH, EnumShape.SPHERE_EIGHTH_LARGE, EnumShape.SPHERE_EIGHTH_LARGE_REV),
new ShapePage("Classical",
new ShapePage("architecturecraft.shapepage.classical",
EnumShape.PILLAR_BASE, EnumShape.PILLAR, EnumShape.DORIC_CAPITAL, EnumShape.DORIC_TRIGLYPH, EnumShape.DORIC_TRIGLYPH_CORNER, EnumShape.DORIC_METOPE,
EnumShape.IONIC_CAPITAL, EnumShape.CORINTHIAN_CAPITAL, EnumShape.ARCHITRAVE, EnumShape.ARCHITRAVE_CORNER, EnumShape.CORNICE_LH, EnumShape.CORNICE_RH,
EnumShape.CORNICE_END_LH, EnumShape.CORNICE_END_RH, EnumShape.CORNICE_RIDGE, EnumShape.CORNICE_VALLEY, EnumShape.CORNICE_BOTTOM),
new ShapePage("Window",
new ShapePage("architecturecraft.shapepage.window",
EnumShape.WINDOW_FRAME, EnumShape.WINDOW_CORNER, EnumShape.WINDOW_MULLION),
new ShapePage("Arches",
new ShapePage("architecturecraft.shapepage.arches",
EnumShape.ARCH_D_1, EnumShape.ARCH_D_2, EnumShape.ARCH_D_3_A, EnumShape.ARCH_D_3_B, EnumShape.ARCH_D_3_C, EnumShape.ARCH_D_4_A, EnumShape.ARCH_D_4_B, EnumShape.ARCH_D_4_C),
new ShapePage("Railings",
new ShapePage("architecturecraft.shapepage.railings",
EnumShape.BALUSTRADE_PLAIN, EnumShape.BALUSTRADE_PLAIN_OUTER_CORNER, EnumShape.BALUSTRADE_PLAIN_INNER_CORNER,
EnumShape.BALUSTRADE_PLAIN_WITH_NEWEL, EnumShape.BALUSTRADE_PLAIN_END,
EnumShape.BANISTER_PLAIN_TOP, EnumShape.BANISTER_PLAIN, EnumShape.BANISTER_PLAIN_BOTTOM, EnumShape.BANISTER_PLAIN_END, EnumShape.BANISTER_PLAIN_INNER_CORNER,
EnumShape.BALUSTRADE_FANCY, EnumShape.BALUSTRADE_FANCY_CORNER, EnumShape.BALUSTRADE_FANCY_WITH_NEWEL, EnumShape.BALUSTRADE_FANCY_NEWEL,
EnumShape.BANISTER_FANCY_TOP, EnumShape.BANISTER_FANCY, EnumShape.BANISTER_FANCY_BOTTOM, EnumShape.BANISTER_FANCY_END, EnumShape.BANISTER_FANCY_NEWEL_TALL),
new ShapePage("Other",
new ShapePage("architecturecraft.shapepage.other",
EnumShape.CLADDING_SHEET, EnumShape.SLAB, EnumShape.STAIRS, EnumShape.STAIRS_OUTER_CORNER, EnumShape.STAIRS_INNER_CORNER),
};

Expand Down
16 changes: 14 additions & 2 deletions src/main/resources/assets/architecturecraft/lang/en_US.lang
Expand Up @@ -30,8 +30,8 @@ architecturecraft.shape.bevelled_outer_corner=Bevelled Outer Corner
architecturecraft.shape.bevelled_inner_corner=Bevelled Inner Corner
architecturecraft.shape.pillar_base=Round Pillar Base
architecturecraft.shape.doric_capital=Doric Capital
architecturecraft.shape.ionic_capital=Ionic capital
architecturecraft.shape.corinthian_capital=Corinthian capital
architecturecraft.shape.ionic_capital=Ionic Capital
architecturecraft.shape.corinthian_capital=Corinthian Capital
architecturecraft.shape.doric_triglyph=Triglyph
architecturecraft.shape.doric_triglyph_corner=Triglyph Corner
architecturecraft.shape.doric_metope=Metope
Expand Down Expand Up @@ -92,5 +92,17 @@ architecturecraft.shape.stairs=Stairs
architecturecraft.shape.stairs_outer_corner=Stairs Outer Corner
architecturecraft.shape.stairs_inner_corner=Stairs Inner Corner

architecturecraft.shapepage.roofing=Roofing
architecturecraft.shapepage.rounded=Rounded
architecturecraft.shapepage.classical=Classical
architecturecraft.shapepage.window=Window
architecturecraft.shapepage.arches=Arches
architecturecraft.shapepage.railings=Railings
architecturecraft.shapepage.other=Other

tooltip.architecturecraft.basematerial=Base: %s
tooltip.architecturecraft.secondarymaterial=Secondary: %s
tooltip.architecturecraft.cutfrom=Cut from: %s

architecturecraft.gui.sawbench.title=Sawbench
architecturecraft.gui.sawbench.ratio=%s makes %s
96 changes: 96 additions & 0 deletions src/main/resources/assets/architecturecraft/lang/ru_RU.lang
Expand Up @@ -8,5 +8,101 @@ item.architecturecraft.cladding.name=Кровля
itemGroup.architecture.tool=Инструменты архитектора
itemGroup.architecture.shape=Блоки архитектора

architecturecraft.shape.roof_tile=Крыша
architecturecraft.shape.roof_outer_corner=Внешний угол крыши
architecturecraft.shape.roof_inner_corner=Внутренний угол крыши
architecturecraft.shape.roof_ridge=Конёк остроконечной крыши
architecturecraft.shape.roof_smart_ridge=Конёк шатровой крыши
architecturecraft.shape.roof_valley=Впадина остроконечной крыши
architecturecraft.shape.roof_smart_valley=Впадина шатровой крыши
architecturecraft.shape.roof_overhang=Навес крыши
architecturecraft.shape.roof_overhang_outer_corner=Внешний угол навеса крыши
architecturecraft.shape.roof_overhang_inner_corner=Внутренний угол навеса крыши
architecturecraft.shape.cylinder=Цилиндр
architecturecraft.shape.cylinder_half=Половина цилиндра
architecturecraft.shape.cylinder_quarter=Четверть цилиндра
architecturecraft.shape.cylinder_large_quarter=Скруглённый внешний угол
architecturecraft.shape.anticylinder_large_quarter=Скруглённый внутренний угол
architecturecraft.shape.pillar=Круглая колонна
architecturecraft.shape.post=Круглый столб
architecturecraft.shape.pole=Круглый шест
architecturecraft.shape.bevelled_outer_corner=Обрезанный внешний угол
architecturecraft.shape.bevelled_inner_corner=Обрезанный внутренний угол
architecturecraft.shape.pillar_base=Основание круглой колонны
architecturecraft.shape.doric_capital=Дорическая вершина колонны
architecturecraft.shape.ionic_capital=Ионическая вершина колонны
architecturecraft.shape.corinthian_capital=Коринфская вершина колонны
architecturecraft.shape.doric_triglyph=Триглиф
architecturecraft.shape.doric_triglyph_corner=Угловой триглиф
architecturecraft.shape.doric_metope=Метоп
architecturecraft.shape.architrave=Архитрав
architecturecraft.shape.architrave_corner=Угловой архитрав
architecturecraft.shape.window_frame=Оконная рама
architecturecraft.shape.window_corner=Угол оконной рамы
architecturecraft.shape.window_mullion=Средник оконной рамы
architecturecraft.shape.sphere_full=Сфера
architecturecraft.shape.sphere_half=Полусфера
architecturecraft.shape.sphere_quarter=Четверть сферы
architecturecraft.shape.sphere_eighth=Четверть полусферы
architecturecraft.shape.sphere_eighth_large=Внешний скруглённый угол
architecturecraft.shape.sphere_eighth_large_rev=Внутренний скруглённый угол
architecturecraft.shape.roof_overhang_gable_lh=Левый навес
architecturecraft.shape.roof_overhang_gable_rh=Правый навес
architecturecraft.shape.roof_overhang_gable_end_lh=Концевик левого навеса
architecturecraft.shape.roof_overhang_gable_end_rh=Концевик правого навеса
architecturecraft.shape.roof_overhang_ridge=Конёк навеса
architecturecraft.shape.roof_overhang_valley=Впадина навеса
architecturecraft.shape.cornice_lh=Левый карниз
architecturecraft.shape.cornice_rh=Правый карниз
architecturecraft.shape.cornice_end_lh=Концевик левого карниза
architecturecraft.shape.cornice_end_rh=Концевик правого карниза
architecturecraft.shape.cornice_ridge=Конёк карниза
architecturecraft.shape.cornice_valley=Впадина карниза
architecturecraft.shape.cornice_bottom=Нижняя сторона карниза
architecturecraft.shape.cladding_sheet=Покрытие
architecturecraft.shape.arch_d_1=Арка в 1 блок
architecturecraft.shape.arch_d_2=Арка в 2 блока
architecturecraft.shape.arch_d_3_a=Арка в 3 блока: деталь A
architecturecraft.shape.arch_d_3_b=Арка в 3 блока: деталь B
architecturecraft.shape.arch_d_3_c=Арка в 3 блока: деталь C
architecturecraft.shape.arch_d_4_a=Арка в 4 блока: деталь A
architecturecraft.shape.arch_d_4_b=Арка в 4 блока: деталь B
architecturecraft.shape.arch_d_4_c=Арка в 4 блока: деталь C
architecturecraft.shape.banister_plain_bottom=Нижний переход перил
architecturecraft.shape.banister_plain=Лестничные перила
architecturecraft.shape.banister_plain_top=Верхний переход перил
architecturecraft.shape.balustrade_fancy=Балюстрада
architecturecraft.shape.balustrade_fancy_corner=Угол балюстрады
architecturecraft.shape.balustrade_fancy_with_newel=Балюстрада со стойкой
architecturecraft.shape.balustrade_fancy_newel=Стойка балюстрады
architecturecraft.shape.balustrade_plain=Перила
architecturecraft.shape.balustrade_plain_outer_corner=Внешний угол перил
architecturecraft.shape.balustrade_plain_with_newel=Перила со стойкой
architecturecraft.shape.banister_plain_end=Концевик перил
architecturecraft.shape.banister_fancy_newel_tall=Высокая стойка балюстрады
architecturecraft.shape.balustrade_plain_inner_corner=Внутренний угол перил
architecturecraft.shape.balustrade_plain_end=Концевик перил
architecturecraft.shape.banister_fancy_bottom=Нижний переход балюстрады
architecturecraft.shape.banister_fancy=Лестничная балюстрада
architecturecraft.shape.banister_fancy_top=Верхний переход балюстрады
architecturecraft.shape.banister_fancy_end=Концевик балюстрады
architecturecraft.shape.banister_plain_inner_corner=Внутр. угол лестничных перил
architecturecraft.shape.slab=Плита
architecturecraft.shape.stairs=Ступеньки
architecturecraft.shape.stairs_outer_corner=Внешний угол ступенек
architecturecraft.shape.stairs_inner_corner=Внутренний угол ступенек

architecturecraft.shapepage.roofing=Крыша
architecturecraft.shapepage.rounded=Округлые
architecturecraft.shapepage.classical=Классика
architecturecraft.shapepage.window=Окна
architecturecraft.shapepage.arches=Арки
architecturecraft.shapepage.railings=Перила
architecturecraft.shapepage.other=Другое

tooltip.architecturecraft.basematerial=Основной: %s
tooltip.architecturecraft.secondarymaterial=Дополнительный: %s
tooltip.architecturecraft.cutfrom=Материал: %s

architecturecraft.gui.sawbench.title=Верстак архитектора
architecturecraft.gui.sawbench.ratio=Из %s в %s