Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable nested translations #648

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

kevinkasper
Copy link
Contributor

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have updated the documentation accordingly
  • I have added tests to cover my changes

Description

This pull request enables the use of nested translations:

Before

{
    "header.title": "Hello world"
}

After

{
    "header": {
        "title": "Hello world"
    }
}

Remarks

-

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2023

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Nov 27, 2023

File size impact

Merging feat/nested_translations into develop impact files as follow:

empty-piral (no impact)
Files new size
Unmodified (2) 28.8 kB (0 B / +0%) 👻
Total (2) 28.8 kB (0 B / +0%) 👻
minimal-piral (no impact)
Files new size
Unmodified (2) 276 kB (0 B / +0%) 👻
Total (2) 276 kB (0 B / +0%) 👻
sample-cross-fx (no impact)
Files new size
Unmodified (3) 2.23 MB (0 B / +0%) 👻
Total (3) 2.23 MB (0 B / +0%) 👻
sample-piral (+0.24%)
Files new size
src/samples/sample-piral/dist/release/index.0747fd.js 524 kB 👶
src/samples/sample-piral/dist/release/main.e49a32.css 170 kB 👶
src/samples/sample-piral/dist/release/main.59084b.css deleted (-170 kB)
src/samples/sample-piral/dist/release/index.3dbdc4.js deleted (-522 kB)
src/samples/sample-piral/dist/release/index.html 490 B (0 B / +0%) 👻
Total (5) 695 kB (+1.68 kB / +0.24%) ↗️
sample-piral-core (no impact)
Files new size
Unmodified (3) 354 kB (0 B / +0%) 👻
Total (3) 354 kB (0 B / +0%) 👻
Generated by @jsenv/file-size-impact during check-bundle-size#7029720082 on 5d82381

Copy link
Contributor

@FlorianRappl FlorianRappl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good to me (thanks for the PR!), however, we might be able to circumvent the getValue call / dependency by just flattening the input object (see comment). What do you think?

src/plugins/piral-translate/package.json Outdated Show resolved Hide resolved
@FlorianRappl FlorianRappl added this to the 1.4.0 milestone Nov 27, 2023
@FlorianRappl FlorianRappl added enhancement New feature or request plugin Covered by an opt-in plugin for Piral. labels Nov 27, 2023
Copy link
Contributor

@FlorianRappl FlorianRappl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@FlorianRappl FlorianRappl merged commit c39d667 into smapiot:develop Nov 29, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin Covered by an opt-in plugin for Piral.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants