Skip to content

Latest commit

 

History

History
347 lines (217 loc) · 15.6 KB

CHANGELOG.md

File metadata and controls

347 lines (217 loc) · 15.6 KB

Changelog

0.7.2

Patch Changes

  • #4503 350147d6 - Fix an issue where running extract on an existing translation target would rewrite the "id" for placeholders signifying the expression index, which breaks translation targets where the expressions need to be reordered.

  • #4530 258142d2 - Translated message validation that runs before the build step now disregards template literal expressions. This allow source code to have variables in expressions renamed while still keeping the same translations, or avoid errors that could happen from module import order changing which expression gets picked up first when multiple msg() calls with the same id have different expressions. This behavior is more consistent with how a translation unit is identified according to how the message id is generated.

  • Updated dependencies [1a32b61e, 57b00630]:

    • lit@3.1.2

0.7.1

Patch Changes

  • #4299 fffa4406 - Update version range for lit dependency to include v2 (and/or @lit/reactive-element v1). This allows projects still on lit v2 to use this package without being forced to install lit v3.

0.7.0

Minor Changes

  • #4141 6b515e43 - Update TypeScript to ~5.2.0, which includes breaking changes to the TypeScript compiler APIs

Patch Changes

  • Updated dependencies:
    • lit@3.0.0
    • @lit/localize@0.12.0

0.7.0-pre.1

Minor Changes

Patch Changes

0.7.0-pre.0

Minor Changes

  • #3814 23326c6b - Update to TypeScript 5.0, which includes breaking changes to the TypeScript compiler APIs.

Patch Changes

0.6.10

Patch Changes

  • #4175 84bb0523 Thanks @43081j! - Update parse5/tools to simplify importing of node types from the default tree adapter

  • #4168 444599eb Thanks @43081j! - Upgrade parse5 to 7.x in localize-tools and import from root of parse5 where possible

0.6.9

Patch Changes

  • #3800 c5add753 - Relax the typescript version for compatibility with typescript > 4.7 && < 5.0

0.6.8

Patch Changes

0.6.7

Patch Changes

  • #3576 6be30739 - Fix regression in Localize XLIFF serialization. When updating an existing XLIFF file, placeholders would appear in the wrong places.

0.6.6

Patch Changes

  • #3514 78811714 - - Existing XLIFF files will be updated instead of re-generated, so additional data added by other processes (such as state="translated" attributes) will be preserved instead of deleted.
    • XLIFF <note> elements generated by Lit Localize will now have a from="lit-localize" attribute to distinguish them from other notes.
  • Updated dependencies [72fcf0d7]:
    • lit@2.6.0

0.6.5

Patch Changes

  • #3116 7d185b4e - Upgraded TypeScript version to ~4.7.4

  • #3136 afff4c17 - Updated xmldom dependency. Minor change to XML attribute formatting can be expected.

0.6.4

Patch Changes

0.6.3

Patch Changes

  • #2732 3e181bcb - Enforce use of file extensions in imports. Fixes an issue with older TypeScript compilers.

0.6.2

Patch Changes

  • #2692 c41a92c9 - Fix issue with placing expressions as html attribute values in transform mode

0.6.1

Patch Changes

  • #2561 6be4ac29 - Reorder xliff <note> elements to follow <target> elements to be OASIS-compliant

  • Updated dependencies [2c9d0008]:

    • lit@2.2.0

0.6.0

Minor Changes

  • #2405 4a4afa7b - BREAKING Update analysis to consider messages with same id and description to be identical (but no longer checks for expressions to be same) and improve error message on finding incompatible duplicates.

    lit-localize extract will now error if multiple messages had the same text but different desc option. Be sure to add the same desc option for these messages to be considered the same translatable message or add different id options to differentiate them.

  • #2405 4a4afa7b - BREAKING (XLB format only) Add index to name attribute for <ph> tags for tracking placeholder locations.

    XLB format users should run lit-localize extract to regenerate the .xlb file for the source locale and make sure the <ph> tags in other locale files have matching name attribute values to that of the newly generated source file.

Patch Changes

0.5.0

Minor Changes

  • #2275 97f4a3f8 - BREAKING Placeholders containing HTML markup and dynamic expressions are now represented in XLIFF as <x> tags instead of <ph> tags.

    To preserve the previous behavior of using <ph> tags, update your JSON config file and set interchange.placeholderStyle to "ph":

    {
      "interchange": {
        "format": "xliff",
        "placeholderStyle": "ph"
      }
    }

Patch Changes

  • #2286 52c4f32e - Update README to point to new full docs at lit.dev

0.4.0

Minor Changes

  • #2188 9fc5a039 - Added output.outputDir setting for transform mode. Required if tsConfig is not specified.
  • #2188 9fc5a039 - Add inputFiles field, and make tsConfig field optional when inputFiles is specified. If both are set, inputFiles takes precedence over the input files from tsConfig. When tsConfig is not specified, a default config is used that will include .js files.

Patch Changes

  • #2188 9fc5a039 - Fixed the $schema property that is automatically added to @lit/localize-tools config files. It was previously pointing at the incorrect file.
  • Updated dependencies [9fc5a039, 9fc5a039]:
    • @lit/localize@0.11.0

0.3.7

Patch Changes

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2

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.

[0.3.6] - 2021-07-28

Fixed

  • Escaped <, >, and & characters in HTML text content are now preserved when generating runtime & transform mode output. Previously they sometimes were emitted unescaped, generating invalid markup.

[0.3.5] - 2021-07-14

Added

  • Added configureSsrLocalization in @lit/localize-tools/lib/ssr.js which allows for safe concurrent rendering of localized templates with @lit-labs/ssr or other renderers using AsyncLocalStorage.

    import {configureSsrLocalization} from '@lit/localize-tools/lib/ssr.js';
    import {render} from '@lit-labs/ssr';
    import {html} from 'lit';
    
    const {withLocale} = await configureSsrLocalization({
      sourceLocale: 'en',
      targetLocales: ['es', 'nl'],
      loadLocale: (locale) => import(`./locales/${locale}.js`)),
    });
    
    const handleHttpRequest = (req, res) => {
      const locale = localeForRequest(req);
      withLocale(locale, async () => {
        // Any async work can happen in this function, and the request's locale
        // context will be safely preserved for every msg() call.
        await doSomeAsyncWork();
        for (const chunk of render(msg(html`Hello World`))) {
          res.write(chunk);
        }
        res.end();
      });
    };

[0.3.4] - 2021-05-18

Fixed

  • Fix Cannot find module '..../@lit/localize/internal/id-generation.js' error by bumping @lit/localize dependency.

[0.3.3] - 2021-05-18

Fixed

  • Fix bugs relating to expression values being substituted in duplicate or incorrect order in localized templates.

  • Fix bug relating to START_LIT_LOCALIZE_EXPR_ strings appearing inside localized templates.

[0.3.2] - 2021-05-07

Fixed

  • Fixed missing str tag in generated translation templates.

[0.3.1] - 2021-04-20

  • Update dependencies.

[0.3.0] - 2021-04-19

Changed

  • [BREAKING] Lit dependency upgraded to v2.

  • [BREAKING] Replaces Localized mixin transform with @localized decorator and updateWhenLocaleChanges transforms.

[0.2.1] - 2021-04-02

Changed

  • XLIFF file headers have been simplified to:
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">

[0.2.0] - 2021-03-30

Changed

  • [BREAKING] Description comments (// msgdesc:) have been removed in favor of the desc option.

Before:

// msgdesc: Home page
class HomePage {
  hello() {
    // msgdesc: Greeting to Earth
    return msg(html`Hello World`);
  }
  goodbye() {
    // msgdesc: Farewell to Earth
    return msg(html`Goodbye World`);
  }
}

After:

class HomePage {
  hello() {
    return msg(html`Hello World`, {
      desc: 'Home page / Greeting to Earth',
    });
  }
  goodbye() {
    return msg(html`Goodbye World`, {
      desc: 'Home page / Farewell to Earth',
    });
  }
}

[0.1.1] - 2021-03-30

Changed

  • Bumped dependency versions for xmldom and @lit/localize

[0.1.0] - 2021-03-24

Changed

  • Initial release of @lit/localize-tools package. This new package provides the lit-localize binary, while @lit/localize continues to provide the browser library (msg, LocalizedElement, etc.).

  • BREAKING lit-localize now uses JS modules instead of CommonJS, so it requires Node 14 or higher.