Skip to content

Commit

Permalink
Merge pull request #7 from kununu/add-branch-name-request
Browse files Browse the repository at this point in the history
Add branch name request
  • Loading branch information
catarina-lopes-pt authored Feb 21, 2019
2 parents fe286b9 + 5687280 commit 4788f24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phraseapp-cli",
"version": "2.4.1",
"version": "2.4.2",
"description": "",
"main": "index.js",
"bin": {
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ const getProject = config =>
const fetchLocale = (config, projectID, locale) =>
new Promise((resolve, reject) => {
const tag = config.TAG ? `&tag=${config.TAG}` : '';
const branch = config.BRANCH ? `&branch=${config.BRANCH}` : '';

// If there is a fallback specified, include_empty_translations also needs to be set to true
const fallback = config.FALLBACK_LOCALE_ID ? `&include_empty_translations&fallback_locale_id=${config.FALLBACK_LOCALE_ID}` : '';
const localeEndpoint = getPhraseAppApiEndpoint(
`projects/${projectID}/locales/${locale}/download?file_format=${config.FORMAT}${tag}${fallback}`, // eslint-disable-line
`projects/${projectID}/locales/${locale}/download?file_format=${config.FORMAT}${tag}${branch}${fallback}`, // eslint-disable-line
config.TOKEN,
);

Expand Down

0 comments on commit 4788f24

Please sign in to comment.