Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mytaxi:phrase-java-client:phrase-java-client-3.0.0'
}
dependencies {
implementation("com.github.mytaxi:phrase-java-client:phrase-java-client-3.0.0")
}
<dependency>
<groupId>com.github.mytaxi</groupId>
<artifactId>phrase-java-client</artifactId>
<version>phrase-java-client-3.0.0</version>
</dependency>
libraryDependencies += "com.github.mytaxi" % "phrase-java-client" % "phrase-java-client-3.0.0"
:dependencies [[com.github.mytaxi/phrase-java-client "phrase-java-client-3.0.0"]]
This projects contains of services to handle the translations from PhraseApp API v2. It's supposed to expose Phrase translations as POJO or as File within the java world.
PhraseLocaleAPI:
Downloads the locales from phraseApp as POJOs.PhraseLocaleDownloadAPI:
Downloads the translations from phraseApp as file(byte[]).PhraseTranslationAPI:
Downloads the translations from phraseApp as POJOs.Currently this project is not released in the maven central repository. Please install this dependency to your local repository and include the following dependency:
<dependency>
<groupId>com.free-now.apis</groupId>
<artifactId>phrase-java-client</artifactId>
<version>${phrase-java-client.version}</version>
</dependency>
Note: Starting with version 2.0.0, the root package has been changed from com.mytaxi.apis.phrase
to
com.freenow.apis.phrase
and all usages of the library must be updated to the new package.
@Bean
public PhraseAppSyncTask phraseAppSyncTask(final PhraseConfig config)
{
return new PhraseAppSyncTask(config.getAuthToken(), config.getProjectId());
}
@Scheduled(fixedRate = 120000)
public void updatePhraseAppStringsTask()
{
try
{
final PhraseAppSyncTask phraseAppSyncTask = applicationContext.getBean("phraseAppSyncTask",
PhraseAppSyncTask.class);
phraseAppSyncTask.run();
ResourceBundle.clearCache();
}
catch (final Exception e)
{
LOG.error("Error downloading PhraseApp messages due auto sync task!", e);
}
}
In order to make the test work create a file /src/test/resources/com/freenow/phraseapi/config/TestConfig.properties
with the content
authToken=<authToken>
projectId=<projectId>
localeIdDe=<localeIdDe>
export authToken=<authToken>
export projectId=<projectId>
export localeIdDe=<localeIdDe>
mvn release:prepare -P release
mvn release:perform -P release