Skip to content

Commit

Permalink
Update docs, changes for 0.8.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
derkoe committed Jan 14, 2023
1 parent 51a7319 commit 33c0447
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.0] - unreleased
## [0.8.0] - (https://github.com/porscheinformatik/weblate-spring/compare/v0.7.1...v0.8.0) - 2023-01-14

### BREAKING CHANGES

Expand All @@ -14,6 +14,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Features

- Add possibility to load data asynchronously (#49, #58)
- API compatability for Spring Framework 6 / Spring Boot 3 (#59, #60)

## [0.7.1](https://github.com/porscheinformatik/weblate-spring/compare/v0.7.0...v0.7.1) - 2022-12-07

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ set a `ResourceBundleMessageSource` as the parent of the `WeblateMessageSource`.
the message source. This is needed when you want to get all your translations to your client (for example in a Single
Page App). The `AllPropertiesReloadableResourceBundleMessageSource` should also be used in this context.

The implementation can also be switched to use asynchronous loading. In this case the texts will be loaded in a
separate thread in the background. This means that the first time you get a property it will fall-back to the
parent `MessageSource`. As soon as the loading is done the new translated texts will be available.

Here is a full example bean configuration for a Spring Boot app (with "messages" as the default bundle):

```java
Expand All @@ -40,6 +44,7 @@ public WeblateMessageSource messageSource() {
weblateMessageSource.setProject("my-project");
weblateMessageSource.setComponent("my-component");
weblateMessageSource.useAuthentication("api-key");
weblateMessageSource.setAsync(true); // <- set this for asynchronous loading
weblateMessageSource.setParentMessageSource(localMessageSource());
return weblateMessageSource;
}
Expand Down

0 comments on commit 33c0447

Please sign in to comment.