On how OXP authors (if you're among them - read it!) can help localizability

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
Simba
Above Average
Above Average
Posts: 17
Joined: Fri Aug 30, 2024 7:58 pm

On how OXP authors (if you're among them - read it!) can help localizability

Post by Simba »

Krager is now translating various OXPs into Russian. The problem is that he does it by creating his own localized versions, which leads to the impossibility of rapid updates in case of new versions and leads to conflicts due to violation of the order of loading addons.

I decided to try a different approach: specialized OXP, which will contain only localization for already installed original extensions. As I assumed, this would require only redefining certain strings through plist-files, maybe changing values of some js-properties through a script, or some other simple manipulations in the code. Alas, this is not the case. In most cases it is necessary to redefine entire methods through a script, because of which in case of release of a new version of localizable OXP something may certainly break.

Here is an example of my attempt to localize Library OXP (available here https://disk.yandex.ru/d/3IrvCRoQJ5h-Sg). This example is also interesting because one of the scripts collects a string in which the value from the argument of the playerCompletedContract method is substituted, which is just a string constant and is not localized anywhere. Because of this, we had to not only redefine the method, but also make appropriate changes to its logic.

In view of the above, there are some wishes for addon authors:
1) Avoid declaring strings inside methods;
2) If such strings are not some changeable values, then they should be stored in missiontext.plist or descriptions.plist, and in the code to get them by functions like expandMissionText();
3) If there are strings in which some values should be substituted, then they should also be stored in *.plist, and the values should be substituted using [such_constructions] and the same functions;
4) If in your code the string is collected gradually or entirely consists of some non-localizable values (i.e. if they are not specified explicitly in the script, for example, names of ships or goods), it should still be placed in *.plist and collected only by substitution through functions like expandMissionText. This is necessary because localization may require changing the order of such values, adding punctuation marks or suffixes/prefixes;
5) Avoid substitution of string values that cannot be localized (example above with playerCompletedContract).

Therefore, I ask all addon developers to check their OXPs and make appropriate changes.

Before creating the topic, I wanted to make a list of addons that have problems with localization, but after looking through a hundred, I found about 50 problematic ones. I decided not to continue - apparently, about half of all addons are problematic. Here are the ones that I managed to highlight:
cim.gsagostinho.systemfeatures.rings
oolite.oxp.aegidian.LongWayRound
oolite.oxp.Alnivel.RoutePlanner
oolite.oxp.AndreyBelov.BountyInformer
oolite.oxp.AndreyBelov.DuplexFuelTank
oolite.oxp.AndreyBelov.Targeter
oolite.oxp.ArexackHeretic.CargoWreck
oolite.oxp.astrobe.spacecrowds
oolite.oxp.captain_beatnik.Riredi
oolite.oxp.CaptMurphy.BreakableTorusDrive
oolite.oxp.CaptMurphy.BreakableHUDIFFScanner
oolite.oxp.CaptMurphy.EscortContracts
oolite.oxp.CaptMurphy.PoliceIFFScanner
oolite.oxp.CaptMurphy.ShipStorageHelper
oolite.oxp.captsolo.tori2.02
oolite.oxp.capt_murphy.Illegal_Goods_Tweak
oolite.oxp.Cholmondely.Hints
oolite.oxp.cim.combat-simulator
oolite.oxp.cim.cotbs
oolite.oxp.cim.new-cargoes
oolite.oxp.cim.ships-library
oolite.oxp.cim.systemfeatures.sunspots
oolite.oxp.CmdCheyd.DH_AdvancedNavigationComputer
oolite.oxp.CmdCheyd.DH_EmergencyWitchspaceInitiator
oolite.oxp.CmdrWombat.Deposed
oolite.oxp.cody.green-gecko-xl
oolite.oxp.Commander_McLane.Anarchies
oolite.oxp.Commander_McLane.Auto_Eject
oolite.oxp.Commander_McLane.Cataclysm
oolite.oxp.Commander_McLane.Interstellar_Help
oolite.oxp.Commander_McLane.Randomshipnames
oolite.oxp.Commander_McLane.Wormhole_Restoration
oolite.oxp.CommonSenseOTB.ShieldEqualizer+Capacitors
oolite.oxp.Day.Diplomacy
oolite.oxp.Diagoras.MiningContracts
oolite.oxp.Disembodied.FreeTradeZone
oolite.oxp.Draco_Caeles.GenerationShips
oolite.oxp.DrewWagar.TianvePulsar
oolite.oxp.DrNil.YAH
oolite.oxp.DrTripsa.InSystemTrader
oolite.oxp.EricWalch.DeepSpaceDredger
oolite.oxp.EricWalch.DeepSpacePirates
oolite.oxp.EricWalch.MisjumpAnalyser
oolite.oxp.EricWalch.TionislaReporter
oolite.oxp.Frame.FuelCollector
oolite.oxp.IronFist.Draven
oolite.oxp.JohnSmith.LoveCats
oolite.oxp.Killer_Wolf.Adder_Mark_III
oolite.oxp.Layne.DockingFees
oolite.oxp.LittleBear.AsteroidStorm
oolite.oxp.littlebear.blackmonks
oolite.oxp.LittleBear.GalacticAlmanac
Post Reply