sarbian / ModuleManager

176 stars 96 forks source link

Feature request: @descripion ^= : $:#localization_xys : #155

Open zer0Kerbal opened 4 years ago

zer0Kerbal commented 4 years ago

Feature request:

I haven't been able to get this to work so I am asking it to be added as a feature.

Localization support

work with the KSP localization system to allow #tags to be

@descripion ^= : $:#localization_xys :

currently if a #localization tag is patched in - MM doesn't expand the tag (unless I am just doing it incorrectly).

I have several mods that could immediately benefit from this, including Dockingport Descriptions.

Thank you in advance!

118

👍 🚧

7ranceaddic7 commented 3 years ago

@descripion ^= : $:#localization_xys :

Did you get this to work? I think your problem is that you have a space before the end-of-line ($). This is telling the replace to search for a line that has extra white-space at the end of the description. Therefore, unless the author has gone against convention and purposefully inserted a space after the final period, you'll never get a match. The added spacing needs to be a part of the replacement string, not the search string.

Remove the space between the first colon (:) and the EoL ($). Then, insert a space before the localization string.

Use this:

@descripion ^= :$: #localization_xys :

tinygrox commented 1 year ago

@zer0Kerbal actually you can write a MM patch just like this: MM patch:

@descripion ^= #localization_xys

and in the localization file:

#localization_xys = :$: EN_SOME_LOC_TEXTS :  // Just keep everything

other languages:

#localization_xys = :$: Translated_TEXTS :