sillsdev / l10nsharp

A .NET localization library for Windows Forms applications.
3 stars 10 forks source link

Added version of LocalizationManager.Create with param to allow additional GetString methods #75

Closed tombogle closed 4 years ago

tombogle commented 4 years ago

This allows the client to specify additional localization methods when extracting from code. Useful, for example, when using SIL.Localizer to allow L10nSharp to be injected in code that does not depend on it.


This change is Reviewable

tombogle commented 4 years ago

src/L10NSharp/LocalizationManager.cs, line 132 at r1 (raw file):

Previously, andrew-polk wrote…
> ``` > /// additional methods that should be regarded as calls to get localizations. If the method > /// is named "Localize", its signature will be parsed as if it were an extension method > /// where the first parameter is the English string and the second parameter is the ID. > /// Otherwise, it will be treated like a GetString method where the first parameter is > /// the ID and the second parameter is the English string. In both cases, the following > /// additional optional parameters are permitted in this order: comment, tootip, shortcut > ``` Seems worth adding some more of these as test cases... For example, the `Localize` method name, tooltip, shortcut keys.

Probably. Though all the descibed behavior is based on underlying code that didn't actually change.