Skip to content

Latest commit

 

History

History
269 lines (174 loc) · 10.1 KB

CHANGELOG.md

File metadata and controls

269 lines (174 loc) · 10.1 KB

Changelog

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]:

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

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

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.