phrase-api

This projects contains of services to handle the translations from [PhraseApp API v2](http://docs.phraseapp.com/api/v2/). It's supposed to expose Phrase translations as POJO or as File within the java world.

Лицензия

Лицензия

Категории

Категории

Java Языки программирования CLI Взаимодействие с пользователем
Группа

Группа

com.mytaxi.apis
Идентификатор

Идентификатор

phrase-java-client
Последняя версия

Последняя версия

1.0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

phrase-api
This projects contains of services to handle the translations from [PhraseApp API v2](http://docs.phraseapp.com/api/v2/). It's supposed to expose Phrase translations as POJO or as File within the java world.
Ссылка на сайт

Ссылка на сайт

https://github.com/mytaxi/phrase-java-client
Система контроля версий

Система контроля версий

https://github.com/mytaxi/phrase-java-client

Скачать phrase-java-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.mytaxi.apis/phrase-java-client/ -->
<dependency>
    <groupId>com.mytaxi.apis</groupId>
    <artifactId>phrase-java-client</artifactId>
    <version>1.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.mytaxi.apis/phrase-java-client/
implementation 'com.mytaxi.apis:phrase-java-client:1.0.6'
// https://jarcasting.com/artifacts/com.mytaxi.apis/phrase-java-client/
implementation ("com.mytaxi.apis:phrase-java-client:1.0.6")
'com.mytaxi.apis:phrase-java-client:jar:1.0.6'
<dependency org="com.mytaxi.apis" name="phrase-java-client" rev="1.0.6">
  <artifact name="phrase-java-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.mytaxi.apis', module='phrase-java-client', version='1.0.6')
)
libraryDependencies += "com.mytaxi.apis" % "phrase-java-client" % "1.0.6"
[com.mytaxi.apis/phrase-java-client "1.0.6"]

Зависимости

compile (7)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.18
org.apache.httpcomponents : httpcore jar 4.4.4
org.apache.httpcomponents : httpclient jar 4.5.2
com.google.guava : guava jar 19.0
com.fasterxml.jackson.core : jackson-annotations jar [2.7.0,2.8.0)
com.fasterxml.jackson.core : jackson-databind jar [2.7.0,2.8.0)
org.assertj : assertj-core jar 3.8.0

provided (2)

Идентификатор библиотеки Тип Версия
org.springframework : spring-web jar 3.2.15.RELEASE
org.springframework : spring-core jar 3.2.15.RELEASE

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19
ch.qos.logback : logback-classic jar 1.1.6
org.aeonbits.owner : owner jar 1.0.9

Модули Проекта

Данный проект не имеет модулей.

Phrase-Java-Client

Build Status Maven Central

What is this?

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.

This project consists of 3 main phraseApp services:

  • 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.

How to use this project

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.mytaxi.apis</groupId>
    <artifactId>phrase-java-client</artifactId>
    <version>1.0.4</version>
</dependency>

What you have to do to start it in an spring application?

Create the bean PhraseAppSyncTask to run this job scheduled lately.

@Bean
public PhraseAppSyncTask phraseAppSyncTask(final PhraseConfig config)
{
    return new PhraseAppSyncTask(config.getAuthToken(), config.getProjectId());
}

Create a scheduling to run this job frequently.

@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);
    }
}

Developers

In order to make the test work create a file /src/test/resources/com/mytaxi/phraseapi/config/TestConfig.properties with the content

authToken=<authToken>
projectId=<projectId>
localeIdDe=<localeIdDe>

Deploy to OSS Sonatype

export authToken=<authToken>
export projectId=<projectId>
export localeIdDe=<localeIdDe>
mvn release:prepare -P release
mvn release:perform -P release

TODOs

  • add tests for main functionality of the services localedownload, translation

Версии библиотеки

Версия
1.0.6
1.0.5
1.0.4
1.0.3
1.0.1
1.0.0