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

Rework locale change #625

Merged
merged 14 commits into from
Jun 11, 2021
Merged

Rework locale change #625

merged 14 commits into from
Jun 11, 2021

Conversation

Demivan
Copy link
Member

@Demivan Demivan commented Jun 10, 2021

Initialization code changed.
from:

const enBundle = new FluentBundle('en')
const ukBundle = new FluentBundle('uk')

const fluent = createFluentVue({
  locale: 'en',
  bundles: [enBundle, ukBundle] 
})

to:

const enBundle = new FluentBundle('en')
const ukBundle = new FluentBundle('uk')

const fluent = createFluentVue({
  bundles: [enBundle] 
})

Instead of using locale property to select current locale, bundles property is now used as current negotiated fallback chain of languages.

This allows consumers to choose language negotiation logic suitable for their app.

@codecov
Copy link

codecov bot commented Jun 10, 2021

Codecov Report

Merging #625 (8ff3341) into develop (b10100d) will decrease coverage by 1.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #625      +/-   ##
===========================================
- Coverage    84.36%   83.18%   -1.19%     
===========================================
  Files           11       11              
  Lines          243      220      -23     
  Branches        37       35       -2     
===========================================
- Hits           205      183      -22     
  Misses          26       26              
+ Partials        12       11       -1     
Flag Coverage Δ
vue-2 76.81% <100.00%> (-1.79%) ⬇️
vue-3 76.36% <100.00%> (-1.83%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/fluent-vue/src/TranslationContext.ts 100.00% <100.00%> (ø)
packages/fluent-vue/src/composition.ts 100.00% <100.00%> (+2.50%) ⬆️
packages/fluent-vue/src/getContext.ts 100.00% <100.00%> (ø)
packages/fluent-vue/src/index.ts 100.00% <100.00%> (ø)
packages/fluent-vue/src/vue/component.ts 89.65% <100.00%> (ø)
packages/fluent-vue/src/vue/directive.ts 76.08% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 092e891...8ff3341. Read the comment docs.

@Demivan Demivan added breaking Type: Feature Includes new features labels Jun 10, 2021
@Demivan Demivan merged commit 059ce03 into develop Jun 11, 2021
@Demivan Demivan added the Type: Breaking Breaking change for library users label Jun 12, 2021
@Demivan Demivan deleted the rework-locale-change branch June 12, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Breaking change for library users Type: Feature Includes new features
Development

Successfully merging this pull request may close these issues.

1 participant