🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

com.free-now.apis:phrase-java-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.free-now.apis:phrase-java-client

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.

3.0.0
Source
Maven
Version published
Maintainers
1
Source

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

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/freenow/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

FAQs

Package last updated on 22 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts