All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- BREAKING CHANGE: If no
LocalizationManager
s have been created, but the client asks for a string to be localized, anInvalidOperationException
is thrown. This is to prevent an invalid state where language IDs get mapped incorrectly at the beginning and then never get updated which can cause us to fail to return properly localized strings when requested (see BL-13245). This is a breaking change because it may cause existing code to throw an exception. The fix is to ensure that a LocalizationManager is created before calling any localization methods. Or, to maintain existing behavior, setLocalizationManager.StrictInitializationMode
to false.
LocalizationManager.Create
methods withoutTranslationMemory kind
parameter
LocalizationManager.Create("es"
loadses-ES
if it is the best match (previously, this resulted in a dialog making the user choose)
LocalizationManager.Create
methods withTranslationMemory kind
parameter
- Added cleanUpTmx parameter to LocalizationManager.DeleteOldTranslationFiles to allow for cleanup of old TMX files.
- TMX-based localization no longer supported
- LocalizationManager.GetTranslationFileNameForLanguage is no longer public.
- option
LocalizationManager.ThrowIfManagerDisposed
to not throw if LM disposed (BL-9904) - XliffBody.TransUnitsUnordered for where you just need to enumerate all of them.
- (Made public) XliffBody.AddTransUnit and .RemoveTransUnit for where you need to modify.
- XliffBody.TransUnitsForXml. This is necessarily public to support (backwards-compatible) serialization and deserialization in XML, but is not intended for any other purpose.
- Scanning resources for strings no longer rethrows unexpected exceptions. It now writes the exception (and stack trace) using a (conditional) Console.WriteLine and a Debug.WriteLine. Rethrowing the exception leads to creating a zero-length xliff file which causes another exception. Swallowing the exception allows the scanning process to continue and complete. The old behavior has been an endless source of periodic instability in using L10NSharp over the years.
- remove progress dialog when initializating Xliff localization managers (BL-11157)
- Made string retrieval operations on Xliff-based LocalizationManagers thread-safe
- Added ILocalizationManager parameter to StringsLocalizedHandler
- It's long been a convention that xliff file names are module.lang.xlf (e.g., Bloom.fr.xlf) or else kept in language-code folders (.../en/Bloom.xlf) if UseLanguageCodeFolders is set. With the latest changes, this is required: the language name indicated in these ways in the file name must match the language declared in the target-language attribute, or at least match the first element of the target-language (e.g., a file with target-languge es-ES may be stored in file like Bloom.es.xlf or .../es/Bloom.xlf).
- Progress dialogs are no longer shown when initializing XLIFF-based LocalizationManagers.
- Made it possible for caller to specify the file extension of the "original" executable file when constructing an XLIFF-based LocalizationManager.
- Changed the way the "original" attribute is set in XLIFF files. It used to be based on the Name, but changed it to use Id instead.
- Added optional owner parameter to methods that show dialog boxes so that they can be displayed centered on a parent window (and not appear off-screen).
- XliffBody.TransUnits, as there is no good way to make this thread-safe for all the ways it could be used, such as adding items to the list. (See Added for replacements.)
- Add
ExtractXliff
tool as nuget package - Add
CheckOrFixXliff
tool as nuget package - Added version of LocalizationManager.Create to allow "custom" localization methods
- Added -m switch to ExtractXliff command-line to allow caller to pass additional string-localization methods
- Add build number to AssemblyFileVersion
- If translator returns an unmodified source string, don't substitute the English language name for the vernacular name.
- create symbol nuget package
-
Find TMX files in
Generated
andUser Modified
directories -
Don't ask Bing translator to translate language names: #66. Also don't display the name a second time in parentheses if English and native name are identical.
-
Allow to select translation memory (TMX or XLIFF). This changed a few APIs. To create a
LocalizationManager
you now pass aTranslationMemory
parameter (cf. migration guide):LocalizationManager.Create(TranslationMemory.XLiff, lang, "SampleApp", "SampleApp", Application.ProductVersion, directoryOfInstalledXliffFiles, "MyCompany/L10NSharpSample", icon, "[email protected]", "SampleApp");
-
Nuget package is now called
L10NSharp
instead ofL10NSharp.xliff
orL10NSharp.tmx
- Create .exe for
CheckOrFixXliff
andExtractXliff
instead of .dll
- Create nuget package
- Strong-name assembly