public class TransifexClient extends Object
| Constructor and Description |
|---|
TransifexClient(String host) |
| Modifier and Type | Method and Description |
|---|---|
String[] |
createProject(String projectId,
String name,
String shortDescription,
LocaleId srcLoc,
boolean isPrivate,
String projectURL)
Creates an open-source project new project if one does not exists already.
|
String[] |
createProject(String projectId,
String name,
String shortDescription,
String longDescription)
Deprecated.
|
String |
getHost() |
Object[] |
getInformation(String resId,
LocaleId locId)
Gets information about a given resource for a given locale.
|
String |
getProject() |
String[] |
getResource(String resourceId,
LocaleId trgLoc,
String outputPath)
Pulls a resource from the current project.
|
Object[] |
getResourceList(LocaleId srcLoc)
Retrieves the list of the resources for the current project, for a given source locale.
|
String[] |
putSourceResource(String poPath,
LocaleId srcLoc,
String resourceFile)
Add a resource to the current project.
|
String[] |
putTargetResource(String poPath,
LocaleId trgLoc,
String resourceSlug,
String resourceFile) |
String[] |
putTargetResourceV2(String poPath,
LocaleId trgLoc,
String resourceSlug,
String resourceFile) |
void |
setCredentials(String username,
String password) |
void |
setHost(String host) |
void |
setProject(String project) |
public TransifexClient(String host)
public void setHost(String host)
public String getHost()
public void setProject(String project)
public String getProject()
@Deprecated public String[] createProject(String projectId, String name, String shortDescription, String longDescription)
createProject(String, String, String, LocaleId, boolean, String) instead.projectId - the project Id.name - the name of the project.shortDescription - a short description (can be null).longDescription - a longer description (can be null).public String[] createProject(String projectId, String name, String shortDescription, LocaleId srcLoc, boolean isPrivate, String projectURL)
projectId - the project Id.name - the name of the project.shortDescription - a short description (can be null).srcLoc - source locale.isPrivate - true for a private project, false for a public one.projectURL - the URL of the project (mandatory for FOSS projects)public String[] putSourceResource(String poPath, LocaleId srcLoc, String resourceFile)
poPath - the full path of the PO file to add.srcLoc - the locale of the source text.resourceFile - filename of the resource (must be the same for all languages)
or null to use the filename of the path.public String[] putTargetResource(String poPath, LocaleId trgLoc, String resourceSlug, String resourceFile)
public String[] putTargetResourceV2(String poPath, LocaleId trgLoc, String resourceSlug, String resourceFile)
public String[] getResource(String resourceId, LocaleId trgLoc, String outputPath)
resourceId - the id of the resource to pull.trgLoc - the target locale of the resource to pull.outputPath - the output path of the resulting PO file.public Object[] getInformation(String resId, LocaleId locId)
resId - the identifier of the resource.locId - the locale identifierpublic Object[] getResourceList(LocaleId srcLoc)
srcLoc - the source locale.Copyright © 2021. All rights reserved.