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

Release: 0.1.1 #24

Merged
merged 4 commits into from
Mar 19, 2021
Merged

Release: 0.1.1 #24

merged 4 commits into from
Mar 19, 2021

Conversation

wyngarde
Copy link

Merged Pull Requests:
#20 : Refactor cache policies

stelabouras and others added 4 commits February 24, 2021 15:11
`TXPreferredLocaleProvider` used to rely on the
`NSLocale.autoupdatingCurrent` property to fetch the current locale of
the device, but the property was not returning the correct language
code.

The updated code looks into the `preferredLanguages` property list of
the `Locale` class instead, and if that list is not empty (which is
usually the case), picks the first language and sets it as the current
locale, which reflects the user choice.

On top of that, a new unit test method is added that adds the greek
language in the list of the preferred languages and asserts whether that
language code is returned by the `TXLocaleState.currentLocale` property.

Last, some existing unit tests that were not running are
now enabled.
Preferred locale provider returns correct language code
Refactors cache policies based on the latest discussion between
@dbendilas and @Petrakeas.

The empty translations (`""`) are now added in the cache (depending on
the policy) and they are not filtered out.

A helpful cheat-sheet table has been added in the documentation of the
`TXCacheOverridePolicy` and the policy documentation has been also
updated.

The cache now defaults to the `.overrideUsingTranslatedOnly` instead of
the `.overrideAll` policy, if no policy is specified by the developer.

If a cache entry is found to contain an empty string during rendering,
the logic falls back to the missing policy.

The documentation of the `TXDiskCacheProvider` has been updated to
declare that it initializes the disk cache provider synchronously.

* Improves policy unit tests by using the table provided in the
documentation to initialize a memory cache and a set of new
translations.

* Adds a unit test that tests whether the read only cache
(`TXReadOnlyCacheDecorator`) is immutable.

* Refactors `TXStandardCache` to use a static method that constructs and
returns the `TXCache` object instead of using the decorator pattern.

Updates the default standard cache usage in the `NativeCore` class and
the README instructions.

* Renames override policy enum to update policy and updates the values to
match the ones used by the Java SDK.

* Replaces occurrences of the 'override' term (relating to the override
policy) with the 'update' term, to match the rename of the override
policy enum.

* Updates CHANGELOG, bumps version
@wyngarde wyngarde merged commit db39894 into master Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants