RimWorld

RimWorld

Quick Stockpile Creation
slofa  [developer] 19 Nov, 2020 @ 3:35pm
For anyone wanting to provide translations...
Please replace the text in the XML tags below and post back on this thread. I can't promise to get to them it straight away, but I'll try and include any valid translations.

<?xml version="1.0" encoding="utf-8" ?> <LanguageData> <!--Controller--> <Quick_Stockpile_Creation>Quick Stockpile Creation</Quick_Stockpile_Creation> <Create_new_stockpiles_at_this_priority>Create new stockpiles at this priority</Create_new_stockpiles_at_this_priority> <Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above>Where items are already in stockpiles, create a stockpile at a higher priority, overriding the value above</Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above> <!--ThingExtensions--> <Unable_to_use_a_higher_priority_for_new_stockpile_item_was_already_in_a_maximumPriority_priority_stockpile>Unable to use a higher priority for new stockpile, item was already in a {maximumPriority} priority stockpile</Unable_to_use_a_higher_priority_for_new_stockpile_item_was_already_in_a_maximumPriority_priority_stockpile> <!--ReallowInStockpileGizmo--> <Reallow_in_stockpile>Reallow in stockpile</Reallow_in_stockpile> <Reallow_this_item_in_its_stockpile>Reallow this item in its stockpile</Reallow_this_item_in_its_stockpile> <Stockpile_will_again_allow_thing_in_it>{zoneStockpileLabel} will again allow {thingLabel} in it</Stockpile_will_again_allow_thing_in_it> <!--RemoveFromStockpileGizmo--> <Disallow_in_stockpile>Disallow in stockpile</Disallow_in_stockpile> <Disallow_this_item_in_its_current_stockpile>Disallow this item in its current stockpile</Disallow_this_item_in_its_current_stockpile> <Disallow_label_in_its_current_stockpile>Disallow {label} in its current stockpile</Disallow_label_in_its_current_stockpile> <Stockpile_will_no_longer_allow_label_in_it>{stockpile} will no longer allow {label} in it</Stockpile_will_no_longer_allow_label_in_it> <!--SmartStockpileFloatMenuOption--> <Create_thing_stockpile>Create {thing} stockpile</Create_thing_stockpile> <!--SmartStockpileGizmo--> <Create_stockpile>Create stockpile</Create_stockpile> <Create_a_stockpile_specifically_for_this_item_type>Create a stockpile specifically for this item type.</Create_a_stockpile_specifically_for_this_item_type> <There_are_no_shared_categories_for_the_items_selected>There are no shared categories for the items selected.</There_are_no_shared_categories_for_the_items_selected> <Multiple_item>Multiple item</Multiple_item> <!--SmartStockpileDesignator--> <Stockpile_name_template>{nonGenericRoomType} {stockpileContents} stockpile zone</Stockpile_name_template> </LanguageData>
Last edited by slofa; 25 Nov, 2020 @ 10:03am
< >
Showing 1-8 of 8 comments
Reiquard 21 Nov, 2020 @ 12:41pm 
If you still get to making changes to the code, I have prepared ready-made options for you.
I have decompiled this mod and made some minor changes regarding translation capability (I dare to hope my actions are OK with you) and hope you find these changes acceptable.
I have to note also that with these changes applied, English language users will not notice any difference.

Under this link[github.com] there are English and Russian translation files along with the lines of code that need to be changed and some comments on important points.

As for the <Quick_Stockpile_Creation>Quick Stockpile Creation</Quick_Stockpile_Creation> - let this line remain untranslated to Russian (at least).

I thank you for your willingness to make changes regarding the translation options.
slofa  [developer] 23 Nov, 2020 @ 4:37am 
I have absolutely no problem with people decompiling the mod... it's public domain in that respect. However, I'm not sure how I'd integrate any changes you've made as decompiled source (particularly on a release build) will bear only a passing similarity to the source, and I've made other (as yet unreleased) changes - including some related to translations. If you're comfortable with the XML structure above you could provide the translations you've already done in that format and I'd be happy to include them (and credit you, obviously!)
Reiquard 23 Nov, 2020 @ 1:52pm 
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<!--Controller-->
<Quick_Stockpile_Creation>Quick Stockpile Creation</Quick_Stockpile_Creation>
<Create_new_stockpiles_at_this_priority>Создавать новые склады с этим приоритетом</Create_new_stockpiles_at_this_priority>
<Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above>Если предмет уже находится на складе, создать для него другой склад с более высоким приоритетом, переопределяя значение выше</Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above>
<!--ThingExtensions-->
<Unable_to_use_a_higher_priority_for_new_stockpile_item_was_already_in_a_maximumPriority_priority_stockpile>Невозможно использовать более высокий приоритет для нового склада, предмет уже находится на складе с приоритетом "{maximumPriority}"</Unable_to_use_a_higher_priority_for_new_stockpile_item_was_already_in_a_maximumPriority_priority_stockpile>
<!--ReallowInStockpileGizmo-->
<Reallow_in_stockpile>Разрешить на складе</Reallow_in_stockpile>
<Reallow_this_item_in_its_stockpile>Разрешить этот предмет на текущем складе.</Reallow_this_item_in_its_stockpile>
<Stockpile_will_again_allow_thing_in_it>"{zoneStockpileLabel}" снова принимает предметы "{thingLabel}"</Stockpile_will_again_allow_thing_in_it>
<!--RemoveFromStockpileGizmo-->
<Disallow_in_stockpile>Запретить на складе</Disallow_in_stockpile>
<Disallow_this_item_in_its_current_stockpile>Запретить этот предмет на текущем складе.</Disallow_this_item_in_its_current_stockpile>
<Disallow_label_in_its_current_stockpile>Запретить предметы "{label}" на текущем складе</Disallow_label_in_its_current_stockpile>
<Stockpile_will_no_longer_allow_label_in_it>"{stockpile}" больше не принимает предметы "{label}"</Stockpile_will_no_longer_allow_label_in_it>
<!--SmartStockpileFloatMenuOption-->
<Create_thing_stockpile>Создать склад для "{thing}"</Create_thing_stockpile>
<!--SmartStockpileGizmo-->
<Create_stockpile>Создать склад</Create_stockpile>
<Create_a_stockpile_specifically_for_this_item_type>Создать склад исключительно для этого типа предметов.</Create_a_stockpile_specifically_for_this_item_type>
<There_are_no_shared_categories_for_the_items_selected>Для выбранных предметов нет общих категорий.</There_are_no_shared_categories_for_the_items_selected>
</LanguageData>

There are also a several more strings left that were not mentioned (unless you deleted some of them):
<!--SmartStockpileGizmo-->
<!-- EN -->
<Multiple_item>Multiple item</Multiple_item>
<!-- RU -->
<Multiple_item>Несколько предметов</Multiple_item>

<!--SmartStockpileDesignator-->
<!-- EN -->
<Room_label_stockpile_zone>{0}{1} stockpile zone</Room_label_stockpile_zone>
<Room_>{0} </Room_><!-- This string is used as the first argument of Room_label_stockpile_zone -->
<!-- RU -->
<Room_label_stockpile_zone>Склад "{1}"{0}</Room_label_stockpile_zone>
<Room_> - {0}</Room_>

There are two substrings for flexibility (due to differences in language structures in various languages)
Take this for reference:
"Room_label_stockpile_zone".Translate(
((room.Role.defName != "None" && room.Role.defName != "Room") ? ("Room_".Translate(room.Role.label).ToString()) : ""),
_stockpileContentsLabel).CapitalizeFirst();
Last edited by Reiquard; 23 Nov, 2020 @ 1:55pm
Reiquard 23 Nov, 2020 @ 3:19pm 
Also, as for the {maximumPriority} argument - I would like to advise you to use it with .Label(), otherwise it won't translate.
ThingExtensions.maximumPriority:
EN "Critical"; RU "Critical"
ThingExtensions.maximumPriority.Label():
EN "critical"; RU "максимальный"
Last edited by Reiquard; 23 Nov, 2020 @ 3:31pm
slofa  [developer] 25 Nov, 2020 @ 10:06am 
All the above noted, and thank you. I've release a version that includes the change to allow translation and also your suggested Russian translation. Regarding the stockpile naming based on room and stockpile contents type, I think I've interpreted your code's intent correctly. If there's any change needed feel free to let me know.
Reiquard 25 Nov, 2020 @ 4:32pm 
Thank you so much for the update - everything works correctly, besides a few minor details that are not directly relevant to your code implementation.

Under spoiler is boring/unnecessary information, where I tried to explain why it is needed to rename the folder:
The official translation for the game on github is updated periodically, while the one that comes out during the game's release becomes partially outdated, so there is a possibility of two game language options: [Russian (Русский)] and [Russian]
If I set game language to [Russian (Русский)], the game will consider all the mod language folder names: [Russian (Русский)] or [Russian], but if I set game language to [Russian], the game will only search for the translation inside the folder named [Russian].

So the folder name [Russian] will be more universal:
[../Quick Stockpile Creation/Languages/Russian/Keyed/]

Due to the fact that it is quite difficult to implement noun declension in the current context, the best solution I found is to use quotation marks for the stockpile contents (string for replace):
<Stockpile_name_template>Склад "{stockpileContents}" - {nonGenericRoomType}</Stockpile_name_template>

One settings string, as it turned out, does not fit into the allotted space a little and looked cropped, so here's the string for replace:
<Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above>Если предмет уже находится на складе, создать для него другой склад с более высоким приоритетом</Where_items_are_already_in_stockpiles_create_a_stockpile_at_a_higher_priority_overriding_the_value_above>

Thank you again and sorry for bothering you.
Last edited by Reiquard; 25 Nov, 2020 @ 4:45pm
slofa  [developer] 26 Nov, 2020 @ 12:52pm 
No need to thank me and it's no bother at all. :) I've made the updates from the above.
Reiquard 26 Nov, 2020 @ 11:19pm 
You've done a good work.
And though you asked not to thank you, I'm very grateful to you.
< >
Showing 1-8 of 8 comments
Per page: 1530 50