Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
alaugks committed Oct 11, 2024
2 parents 5337d1c + 72b0cde commit 8201f8a
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ implementation group: 'io.github.alaugks', name: 'spring-messagesource-xliff', v

## MessageSource Configuration

The class XliffTranslationMessageSource implements the [MessageSource](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/MessageSource.html) interface.

`builder(Locale defaultLocale, String locationPattern)` or<br>
`builder(Locale defaultLocale, List<String> locationPatterns)` (***required***)
* Argument `Locale locale`: Defines the default locale.
Expand All @@ -45,8 +43,6 @@ The class XliffTranslationMessageSource implements the [MessageSource](https://d
* Default locale is `en`.
* The XLIFF files are stored in `src/main/resources/translations`.

#### Version >= 2.0.0

```java
import io.github.alaugks.spring.messagesource.xliff.XliffResourceMessageSource;
import org.springframework.context.MessageSource;
Expand All @@ -70,30 +66,6 @@ public class MessageSourceConfig {
}
```

#### Version <= 1.3.0

```java
import de.alaugks.spring.XliffTranslationMessageSource;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Locale;

@Configuration
public class MessageSourceConfig {

@Bean
public MessageSource messageSource() {
XliffTranslationMessageSource messageSource = new XliffTranslationMessageSource();
messageSource.setDefaultLocale(Locale.forLanguageTag("en"));
messageSource.setBasenamePattern("translations/*");
return messageSource;
}

}
```

## XLIFF Files

* Translations can be separated into different files (domains). The default domain is `messages`.
Expand Down

0 comments on commit 8201f8a

Please sign in to comment.