Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maximilien/i18n4go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.2
Choose a base ref
...
head repository: maximilien/i18n4go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 7,482 additions and 5,992 deletions.
  1. +11 −0 .github/dependabot.yml
  2. +72 −0 .github/workflows/codeql-analysis.yml
  3. +44 −0 .github/workflows/go.yml
  4. +14 −0 .github/workflows/greetings.yml
  5. +19 −0 .github/workflows/stale.yml
  6. +1 −2 .travis.yml
  7. +5 −0 CHANGELOG.md
  8. +0 −28 Godeps/Godeps.json
  9. +0 −5 Godeps/Readme
  10. +0 −2 Godeps/_workspace/.gitignore
  11. +0 −300 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/bundle/bundle.go
  12. +0 −261 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/bundle/bundle_test.go
  13. +0 −63 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/example_test.go
  14. +0 −63 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/exampletemplate_test.go
  15. +0 −139 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/i18n.go
  16. +0 −99 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/language.go
  17. +0 −85 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/language_test.go
  18. +0 −87 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/operands.go
  19. +0 −45 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/operands_test.go
  20. +0 −40 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/plural.go
  21. +0 −28 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/plural_test.go
  22. +0 −405 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/pluralspec.go
  23. +0 −531 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/language/pluralspec_test.go
  24. +0 −78 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation.go
  25. +0 −308 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation_test.go
  26. +0 −57 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go
  27. +0 −80 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/template.go
  28. +0 −146 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/template_test.go
  29. +0 −70 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/translation.go
  30. +0 −17 Godeps/_workspace/src/github.com/nicksnyder/go-i18n/i18n/translation/translation_test.go
  31. +0 −1 Godeps/_workspace/src/github.com/onsi/ginkgo
  32. +0 −1 Godeps/_workspace/src/github.com/onsi/gomega
  33. +0 −11 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/.travis.yml
  34. +0 −201 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/LICENSE
  35. +0 −44 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/README.md
  36. +0 −5 ...ps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/ci/scripts/windows-64-test.bat
  37. +0 −22 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber.go
  38. +0 −13 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber_suite_test.go
  39. +0 −57 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber_unix.go
  40. +0 −103 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber_unix_test.go
  41. +0 −114 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber_windows.go
  42. +0 −50 Godeps/_workspace/src/github.com/pivotal-cf-experimental/jibber_jabber/jibber_jabber_windows_test.go
  43. +91 −61 README.md
  44. +15 −2 bin/build
  45. +15 −0 bin/clean
  46. +15 −2 bin/run
  47. +15 −5 bin/test
  48. +46 −0 bin/validate
  49. +0 −276 cmds/checkup.go
  50. +0 −11 cmds/cmd_interface.go
  51. +0 −207 cmds/create_translations.go
  52. +0 −49 cmds/extract_strings_test.go
  53. +0 −135 cmds/merge_string.go
  54. +0 −23 common/ast.go
  55. +9 −11 examples/demo1-i18n/demo1.go.en.json
  56. +9 −11 examples/demo1-i18n/en.all.json
  57. +9 −11 examples/demo1-i18n/i18n/resources/de.all.json
  58. +9 −11 examples/demo1-i18n/i18n/resources/de_DE.all.json
  59. +9 −11 examples/demo1-i18n/i18n/resources/en_US.all.json
  60. +9 −11 examples/demo1-i18n/i18n/resources/es.all.json
  61. +9 −11 examples/demo1-i18n/i18n/resources/es_ES.all.json
  62. +9 −11 examples/demo1-i18n/i18n/resources/fr.all.json
  63. +9 −11 examples/demo1-i18n/i18n/resources/fr_FR.all.json
  64. +9 −11 examples/demo1-i18n/i18n/resources/zh.all.json
  65. +9 −11 examples/demo1-i18n/i18n/resources/zh_Hans.all.json
  66. +1 −1 examples/demo1-i18n/i18n_init.go
  67. +2 −2 examples/i18n_init/cf_cli_i18n_init.go.template
  68. +32 −0 go.mod
  69. +128 −0 go.sum
  70. +0 −14 i18n/i18n_init.go.template
  71. +0 −137 i18n/init.go
  72. +396 −0 i18n4go/cmds/checkup.go
  73. +25 −0 i18n4go/cmds/cmd_interface.go
  74. +246 −0 i18n4go/cmds/create_translations.go
  75. +147 −37 { → i18n4go}/cmds/extract_strings.go
  76. +74 −30 { → i18n4go}/cmds/fixup.go
  77. +168 −0 i18n4go/cmds/merge_string.go
  78. +134 −38 { → i18n4go}/cmds/rewrite_package.go
  79. +58 −23 { → i18n4go}/cmds/show_missing_strings.go
  80. +12 −0 i18n4go/cmds/types.go
  81. +59 −25 { → i18n4go}/cmds/verify_strings.go
  82. +27 −0 i18n4go/cmds/version.go
  83. +39 −0 i18n4go/common/ast.go
  84. +18 −4 { → i18n4go}/common/cmd.go
  85. +36 −9 { → i18n4go}/common/common.go
  86. +57 −0 i18n4go/i18n/excluded.json
  87. +11 −0 i18n4go/i18n/i18n_init.go
  88. +15 −0 i18n4go/i18n/i18n_init.go.template
  89. +948 −0 i18n4go/i18n/i18n_resources.go
  90. +230 −0 i18n4go/i18n/init.go
  91. +722 −0 i18n4go/i18n/resources/all.en_US.json
  92. +109 −62 i18n4go/i18n4go.go
  93. +14 −0 integration/checkup/checkup_suite_test.go
  94. +199 −40 integration/checkup/checkup_test.go
  95. +14 −0 integration/create_translations/create_translations_suite_test.go
  96. +141 −48 integration/create_translations/f_option_test.go
  97. +114 −37 integration/extract_strings/d_option_test.go
  98. +14 −0 integration/extract_strings/extract_strings_suite_test.go
  99. +112 −42 integration/extract_strings/f_o_options_test.go
  100. +228 −69 integration/extract_strings/f_option_test.go
  101. +130 −0 integration/extract_strings/s_option_test.go
  102. +14 −0 integration/fixup/fixup_suite_test.go
  103. +30 −18 integration/fixup/fixup_test.go
  104. +188 −54 integration/merge_strings/d_option_test.go
  105. +14 −0 integration/merge_strings/merge_strings_suite_test.go
  106. +62 −19 integration/merge_strings/r_option_test.go
  107. +18 −4 integration/merge_strings/source_language_test.go
  108. +381 −153 integration/rewrite_package/d_option_test.go
  109. +336 −128 integration/rewrite_package/f_option_test.go
  110. +249 −94 integration/rewrite_package/i18n_strings_filename_test.go
  111. +208 −79 integration/rewrite_package/init_code_snippet_filename_test.go
  112. +14 −0 integration/rewrite_package/suite_test.go
  113. +88 −26 integration/show_missing_strings/d_option_test.go
  114. +14 −0 integration/show_missing_strings/show_missing_strings_suite_test.go
  115. +14 −0 integration/test_helpers/build_executable.go
  116. +14 −0 integration/test_helpers/helpers.go
  117. +31 −5 integration/verify_strings/duplicate_keys_test.go
  118. +380 −138 integration/verify_strings/f_option_test.go
  119. +14 −0 integration/verify_strings/verify_strings_suite_test.go
  120. +7 −0 test_fixtures/checkup/fileformat/src/code/main.go
  121. 0 ...ures/{fixup/allgood/translations/en_US.all.json → checkup/fileformat/translations/all.en_US.json}
  122. 0 ...ures/{fixup/allgood/translations/zh_CN.all.json → checkup/fileformat/translations/all.zh_CN.json}
  123. +1 −1 test_fixtures/checkup/qualified/src/code/main.go
  124. +12 −0 test_fixtures/checkup/variable/src/code/main.go
  125. +14 −0 test_fixtures/checkup/variable/translations/en_US.all.json
  126. +14 −0 test_fixtures/checkup/variable/translations/zh_CN.all.json
  127. +14 −0 test_fixtures/extract_strings/f_option/expected_output/issue45.go.en.json
  128. +26 −0 test_fixtures/extract_strings/f_option/input_files/issue45.go
  129. +10 −0 test_fixtures/extract_strings/s_option/expected_output/app.go.en.json
  130. +16 −0 test_fixtures/extract_strings/s_option/input_files/app/app.go
  131. +5 −0 test_fixtures/extract_strings/s_option/input_files/matching_group.json
  132. +6 −0 test_fixtures/fixup/allgood/translations/all.en_US.json
  133. +6 −0 test_fixtures/fixup/allgood/translations/all.zh_CN.json
  134. 0 test_fixtures/fixup/notsogood/add/translations/{en_US.all.json → all.en_US.json}
  135. 0 test_fixtures/fixup/notsogood/add/translations/{zh_CN.all.json → all.zh_CN.json}
  136. 0 test_fixtures/fixup/notsogood/delete/translations/{en_US.all.json → all.en_US.json}
  137. 0 test_fixtures/fixup/notsogood/delete/translations/{zh_CN.all.json → all.zh_CN.json}
  138. 0 test_fixtures/fixup/notsogood/extra_foreign_key/translations/{en_US.all.json → all.en_US.json}
  139. +14 −0 test_fixtures/fixup/notsogood/extra_foreign_key/translations/all.zh_CN.json
  140. +0 −17 test_fixtures/fixup/notsogood/extra_foreign_key/translations/zh_CN.all.json
  141. +14 −0 test_fixtures/fixup/notsogood/missing_foreign_key/translations/all.en_US.json
  142. +10 −0 test_fixtures/fixup/notsogood/missing_foreign_key/translations/all.zh_CN.json
  143. +0 −15 test_fixtures/fixup/notsogood/missing_foreign_key/translations/en_US.all.json
  144. +0 −12 test_fixtures/fixup/notsogood/missing_foreign_key/translations/zh_CN.all.json
  145. 0 test_fixtures/fixup/notsogood/multiple_update/translations/{en_US.all.json → all.en_US.json}
  146. 0 test_fixtures/fixup/notsogood/multiple_update/translations/{zh_CN.all.json → all.zh_CN.json}
  147. +14 −0 test_fixtures/fixup/notsogood/update/translations/all.en_US.json
  148. 0 test_fixtures/fixup/notsogood/update/translations/{zh_CN.all.json → all.zh_CN.json}
  149. +0 −17 test_fixtures/fixup/notsogood/update/translations/en_US.all.json
  150. +14 −0 test_fixtures/fixup/notsogood/update_add/translations/all.en_US.json
  151. 0 test_fixtures/fixup/notsogood/update_add/translations/{zh_CN.all.json → all.zh_CN.json}
  152. +0 −17 test_fixtures/fixup/notsogood/update_add/translations/en_US.all.json
  153. +24 −43 test_fixtures/merge_strings/d_option/expected_output/{en.all.json → all.en.json}
  154. 0 test_fixtures/merge_strings/r_option/expected_output/{en.all.json → all.en.json}
  155. 0 test_fixtures/merge_strings/r_option/expected_output/sub/{en.all.json → all.en.json}
  156. 0 test_fixtures/merge_strings/source_language/expected_output/{fr.all.json → all.fr.json}
  157. +17 −21 test_fixtures/rewrite_package/d_option/expected_output/doption/en.all.json
  158. +17 −21 test_fixtures/rewrite_package/d_option/expected_output/doption/test.go.en.json
  159. +17 −21 test_fixtures/rewrite_package/d_option/expected_output/doption/test2.go.en.json
  160. +5 −4 test_fixtures/rewrite_package/f_option/expected_output/i18n_init.go
  161. +5 −4 test_fixtures/rewrite_package/f_option/expected_output/nested_dir/i18n_init.go
  162. +5 −4 test_fixtures/rewrite_package/init_code_snippet_filename/expected_output/i18n_init_default.go
  163. +2 −3 test_fixtures/rewrite_package/init_code_snippet_filename/expected_output/i18n_init_from_template.go
  164. +2 −3 test_fixtures/rewrite_package/init_code_snippet_filename/input_files/init_code_snippet.go.template
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '39 19 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
44 changes: 44 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: '>=1.17'

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Format
run: go fmt ./...

- name: Build
run: ./bin/build

- name: Test
run: |
export GOPATH=$(go env GOPATH)/bin
./bin/test
- name: Validate
run: ./bin/validate
14 changes: 14 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
continue-on-error: true
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thanks for your contribution. Please contact me @maximilien to ensure follow-up.'
pr-message: 'Thanks for your contribution. Please contact me @maximilien to ensure follow-up.'
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "60 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is staled for 60 days'
stale-pr-message: 'This PR is staled for 60 days'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: go
go:
- 1.2
- 1.18
before_install:
- go get golang.org/x/tools/cmd/vet
- go get github.com/onsi/ginkgo/...
- go get github.com/onsi/gomega/...
install: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Changes in v0.2.3
- removed the main/* directory
- added -q flag to checkup to allow qualifiers to be specified, so that i18n.T(...) can be used
- update to README to match new checkup -q flag

# Changes in v0.2.1
- renamed executable to i18n4go
- minor update to README
28 changes: 0 additions & 28 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

2 changes: 0 additions & 2 deletions Godeps/_workspace/.gitignore

This file was deleted.

Loading