Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New Localization module #302

Closed
wants to merge 47 commits into from
Closed

feat: New Localization module #302

wants to merge 47 commits into from

Conversation

kkumar-gcc
Copy link
Member

@kkumar-gcc kkumar-gcc commented Sep 22, 2023

Closes goravel/goravel#39

📑 Description

This PR(Not Finished) introduces a new Lang facade that can be used to implement localization in your application. To utilize this feature, follow these steps:

  1. Create a lang directory in the root of your project:

    lang/
    |-- en.json
    |-- test
    |   |-- zn.json
    |-- zn.json
  2. Update your app.go configuration as follows:

    ...
    
    "locale": "zn",
    "fallback_locale": "en",
    
    ...

Now, you can make use of the Lang facade in your code as demonstrated below:

facades.Lang().Get("test.welcome_message", translation.Option{// key: folder.subfolder.key
	// Locale: "en",
	Replace: map[string]interface{}{
		"name":     "Krishan",
		"location": "India",
	},
})
// Output:
// "welcome_message": "Hello, :name! Welcome to :location."
// Hello, krishan! Welcome to india.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

@kkumar-gcc kkumar-gcc requested a review from a team September 22, 2023 11:35
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Attention: 305 lines in your changes are missing coverage. Please review.

Comparison is base (95f3d3a) 69.24% compared to head (97bb8e2) 69.38%.
Report is 17 commits behind head on master.

❗ Current head 97bb8e2 differs from pull request most recent head 72f7ff2. Consider uploading reports for the commit 72f7ff2 to get more accurate results

Files Patch % Lines
translation/translator.go 55.03% 47 Missing and 11 partials ⚠️
support/docker/database.go 29.41% 24 Missing and 12 partials ⚠️
support/docker/mysql.go 73.33% 16 Missing and 8 partials ⚠️
support/docker/sqlserver.go 73.03% 16 Missing and 8 partials ⚠️
support/docker/postgresql.go 73.07% 14 Missing and 7 partials ⚠️
validation/validator.go 79.16% 15 Missing ⚠️
database/gorm/test_utils.go 85.10% 14 Missing ⚠️
foundation/application.go 0.00% 13 Missing and 1 partial ⚠️
support/docker/sqlite.go 62.50% 8 Missing and 4 partials ⚠️
translation/service_provider.go 0.00% 12 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
+ Coverage   69.24%   69.38%   +0.14%     
==========================================
  Files         143      151       +8     
  Lines        9646    10328     +682     
==========================================
+ Hits         6679     7166     +487     
- Misses       2533     2680     +147     
- Partials      434      482      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good start 👍

contracts/foundation/application.go Show resolved Hide resolved
translation/service_provider.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
translation/file_loader.go Outdated Show resolved Hide resolved
translation/file_loader.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
contracts/translation/loader.go Outdated Show resolved Hide resolved
contracts/foundation/application.go Outdated Show resolved Hide resolved
contracts/translation/translator.go Outdated Show resolved Hide resolved
Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better

contracts/translation/translator.go Show resolved Hide resolved
foundation/container.go Outdated Show resolved Hide resolved
translation/file_loader.go Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
contracts/translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
contracts/foundation/application.go Outdated Show resolved Hide resolved
foundation/application.go Outdated Show resolved Hide resolved
contracts/translation/translator.go Outdated Show resolved Hide resolved
translation/translator.go Outdated Show resolved Hide resolved
return "", err
}

line := t.loaded[folder][locale][keyPart]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Will it panic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it won't panic.

translation/translator.go Show resolved Hide resolved
kkumar-gcc and others added 7 commits October 3, 2023 10:05
* feat: add environment helper

* feat: optimize sonic

* fix: tests

* feat: rename to env

* feat: optimize json

* fix: optimize tests
* feat: update mocks

* refactor: move mocks

* workflow: remove code review

* workflow: fix mockery

* fix: update mocks

* refactor: move gorm initialize interface to contracts folder

* feat: test generate mock

* workflow: update mock

* chore: update mocks

* chore: remove unnecessary go generate tag

* workflow: only generate mocks in master branch

* workflow: fix lint

* workflow: make mockery only run on pr

* feat: move Gorm interface to contracts/database/gorm

* feat: move Gorm interface to contracts/database/gorm

* feat: move interface

* chore: update mocks

* fix: test

---------

Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>
Bumps the go-modules group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).

- [Commits](golang/crypto@v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the github-actions group with 1 update: [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action).

- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](stefanzweifel/git-auto-commit-action@v4...v5)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the go-modules group with 1 update: [github.com/spf13/viper](https://github.com/spf13/viper).

- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
@kkumar-gcc kkumar-gcc marked this pull request as draft October 8, 2023 07:27
dependabot bot and others added 10 commits October 10, 2023 08:31
Bumps the go-modules group with 2 updates: [github.com/bytedance/sonic](https://github.com/bytedance/sonic) and [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).


Updates `github.com/bytedance/sonic` from 1.10.1 to 1.10.2
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.1...v1.10.2)

Updates `github.com/golang-module/carbon/v2` from 2.2.8 to 2.2.9
- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.8...v2.2.9)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….0 (#324)

Bumps [github.com/brianvoe/gofakeit/v6](https://github.com/brianvoe/gofakeit) from 6.23.2 to 6.24.0.
- [Release notes](https://github.com/brianvoe/gofakeit/releases)
- [Commits](brianvoe/gofakeit@v6.23.2...v6.24.0)

---
updated-dependencies:
- dependency-name: github.com/brianvoe/gofakeit/v6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon) from 2.2.11 to 2.2.12.
- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.11...v2.2.12)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Upgrade v1.13.1

* Merge #305, #306 to v1.13.x (#308)

* Upgrade v1.13.1 (#295)

* Update README

* build(deps): bump the go-modules group with 1 update (#296)

Bumps the go-modules group with 1 update: [github.com/bytedance/sonic](https://github.com/bytedance/sonic).

- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#297)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.6...v2.2.7)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#299)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.0...v1.58.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 1 update (#300)

Bumps the github-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action).

- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* feat: add GetBytes method and test cases (#298)

* feat: add GetBytes method and test cases

* workflow: remove filesystem

* fix: lint

* feat: optimize code

* feat: optimize test

* fix: windows tests

* workflow: fix

* fix: file not close

* feat: optimize code

* fix: lint

* fix: lint

* fix: test

* feat: Add interface comments (#292)

* Add interface comments to all facades

* Add comments for remaining contracts

* convert the first letter of word to a lower case in godoc comments

* Add a space for each comment after //

* build(deps): bump the go-modules group with 1 update (#301)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.7...v2.2.8)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#303)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.1...v1.58.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix:[#263] There is a path error in the filesystem module (#305)

* feat: Add Fluent String helpers (#304)

* add fluent strings helpers

* add more fluent string helpers

* add headline helper

* add test cases for fluent strings

* add test cases for headline function

* modify, according to suggestions

* modify, according to suggestions

* reformat the str file

* fix: #267 (#306)

* feat: add environment helper

* feat: optimize sonic

* fix: tests

* feat: rename to env

* feat: optimize json

* fix: optimize tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 耗子 <i@haozi.net>
Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>

* fix: [#270] Optimize postgres DNS (#309)

* fix: [#270] Optimize postgres DNS

* Fix unit test

* fix: [#253] [Bug] The With method can't be used with the Cursor method together (#311)

* fix: #253 [Bug] The With method can't be used with the Cursor method together

* Remove test

* Upgrade v1.13.2

* Update README

* fix: Register multiple events (#317)

* Upgrade v1.13.1 (#295)

* Update README

* build(deps): bump the go-modules group with 1 update (#296)

Bumps the go-modules group with 1 update: [github.com/bytedance/sonic](https://github.com/bytedance/sonic).

- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#297)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.6...v2.2.7)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#299)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.0...v1.58.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 1 update (#300)

Bumps the github-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action).

- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* feat: add GetBytes method and test cases (#298)

* feat: add GetBytes method and test cases

* workflow: remove filesystem

* fix: lint

* feat: optimize code

* feat: optimize test

* fix: windows tests

* workflow: fix

* fix: file not close

* feat: optimize code

* fix: lint

* fix: lint

* fix: test

* feat: Add interface comments (#292)

* Add interface comments to all facades

* Add comments for remaining contracts

* convert the first letter of word to a lower case in godoc comments

* Add a space for each comment after //

* build(deps): bump the go-modules group with 1 update (#301)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.7...v2.2.8)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#303)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.1...v1.58.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix:[#263] There is a path error in the filesystem module (#305)

* feat: Add Fluent String helpers (#304)

* add fluent strings helpers

* add more fluent string helpers

* add headline helper

* add test cases for fluent strings

* add test cases for headline function

* modify, according to suggestions

* modify, according to suggestions

* reformat the str file

* fix: #267 (#306)

* feat: add environment helper

* feat: optimize sonic

* fix: tests

* feat: rename to env

* feat: optimize json

* fix: optimize tests

* refactor: move mocks (#307)

* feat: update mocks

* refactor: move mocks

* workflow: remove code review

* workflow: fix mockery

* fix: update mocks

* refactor: move gorm initialize interface to contracts folder

* feat: test generate mock

* workflow: update mock

* chore: update mocks

* chore: remove unnecessary go generate tag

* workflow: only generate mocks in master branch

* workflow: fix lint

* workflow: make mockery only run on pr

* feat: move Gorm interface to contracts/database/gorm

* feat: move Gorm interface to contracts/database/gorm

* feat: move interface

* chore: update mocks

* fix: test

---------

Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#310)

Bumps the go-modules group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).

- [Commits](golang/crypto@v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 1 update (#312)

Bumps the github-actions group with 1 update: [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action).

- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](stefanzweifel/git-auto-commit-action@v4...v5)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#313)

Bumps the go-modules group with 1 update: [github.com/spf13/viper](https://github.com/spf13/viper).

- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* build(deps): bump the go-modules group with 2 updates (#315)

Bumps the go-modules group with 2 updates: [github.com/bytedance/sonic](https://github.com/bytedance/sonic) and [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).


Updates `github.com/bytedance/sonic` from 1.10.1 to 1.10.2
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.1...v1.10.2)

Updates `github.com/golang-module/carbon/v2` from 2.2.8 to 2.2.9
- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.8...v2.2.9)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Register multiple events

* Fix typo

* Restore

* Allow multiple events registeration

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: Bowen <wenbo.han@compass.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 耗子 <i@haozi.net>
Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>

* fix: database variable (#316)

* Upgrade v1.13.1 (#295)

* Update README

* build(deps): bump the go-modules group with 1 update (#296)

Bumps the go-modules group with 1 update: [github.com/bytedance/sonic](https://github.com/bytedance/sonic).

- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#297)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.6...v2.2.7)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#299)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.0...v1.58.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 1 update (#300)

Bumps the github-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action).

- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* feat: add GetBytes method and test cases (#298)

* feat: add GetBytes method and test cases

* workflow: remove filesystem

* fix: lint

* feat: optimize code

* feat: optimize test

* fix: windows tests

* workflow: fix

* fix: file not close

* feat: optimize code

* fix: lint

* fix: lint

* fix: test

* feat: Add interface comments (#292)

* Add interface comments to all facades

* Add comments for remaining contracts

* convert the first letter of word to a lower case in godoc comments

* Add a space for each comment after //

* build(deps): bump the go-modules group with 1 update (#301)

Bumps the go-modules group with 1 update: [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).

- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.7...v2.2.8)

---
updated-dependencies:
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#303)

Bumps the go-modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).

- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.58.1...v1.58.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix:[#263] There is a path error in the filesystem module (#305)

* feat: Add Fluent String helpers (#304)

* add fluent strings helpers

* add more fluent string helpers

* add headline helper

* add test cases for fluent strings

* add test cases for headline function

* modify, according to suggestions

* modify, according to suggestions

* reformat the str file

* fix: #267 (#306)

* feat: add environment helper

* feat: optimize sonic

* fix: tests

* feat: rename to env

* feat: optimize json

* fix: optimize tests

* refactor: move mocks (#307)

* feat: update mocks

* refactor: move mocks

* workflow: remove code review

* workflow: fix mockery

* fix: update mocks

* refactor: move gorm initialize interface to contracts folder

* feat: test generate mock

* workflow: update mock

* chore: update mocks

* chore: remove unnecessary go generate tag

* workflow: only generate mocks in master branch

* workflow: fix lint

* workflow: make mockery only run on pr

* feat: move Gorm interface to contracts/database/gorm

* feat: move Gorm interface to contracts/database/gorm

* feat: move interface

* chore: update mocks

* fix: test

---------

Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#310)

Bumps the go-modules group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).

- [Commits](golang/crypto@v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 1 update (#312)

Bumps the github-actions group with 1 update: [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action).

- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](stefanzweifel/git-auto-commit-action@v4...v5)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump the go-modules group with 1 update (#313)

Bumps the go-modules group with 1 update: [github.com/spf13/viper](https://github.com/spf13/viper).

- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* build(deps): bump the go-modules group with 2 updates (#315)

Bumps the go-modules group with 2 updates: [github.com/bytedance/sonic](https://github.com/bytedance/sonic) and [github.com/golang-module/carbon/v2](https://github.com/golang-module/carbon).


Updates `github.com/bytedance/sonic` from 1.10.1 to 1.10.2
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](bytedance/sonic@v1.10.1...v1.10.2)

Updates `github.com/golang-module/carbon/v2` from 2.2.8 to 2.2.9
- [Release notes](https://github.com/golang-module/carbon/releases)
- [Commits](golang-module/carbon@v2.2.8...v2.2.9)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
- dependency-name: github.com/golang-module/carbon/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix database variable

* Restore

* Fix database typo

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: Bowen <wenbo.han@compass.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 耗子 <i@haozi.net>
Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>

* feat: [#265] The Config module supports get system environment variables (#329)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Bowen <wenbo.han@compass.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: Ahmed M. Ammar <ahmed3mar@outlook.com>
Co-authored-by: devhaozi <devhaozi@users.noreply.github.com>
* feat: Optimize Validator Bind

* feat: auto cast value

* feat: optimize code

* feat: add test cases

* fix: lint

* fix: lint

* fix: support struct nesting

* feat: add test case

* feat: optimize type

* refactor: use mapstructure to decode struct with cast

* fix: remove unnecessary case

* feat: make validate get field use form tag

* feat: make validate get filtered and safe data

* fix: lint

* feat: remove unnecessary dataFace

* feat: add cast test

* feat: add error message

* fix: tests

* fix: tests

* feat: Update validation/validator_test.go

Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>

* fix: lint

* feat: add more test case

---------

Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
* feat: [#289] Remove github.com/ory/dockertest

* Optmize unit tests

* Optimize unit tests

* Optimizi unit tests

* Optimize unit tests

* Add lock

* Optimize lock

* Optimize locak

* Optimize lock

* Optimize port

* Optimize port

* Optimize windows test

* Remove unnecessary code

* Remove unnecessary code

* Optimize docker structure

* chore: update mocks

* Optimize unit tests

* Optimize unit tests

* Add unit tests

* Upgrade redis

---------

Co-authored-by: hwbrzzl <hwbrzzl@users.noreply.github.com>
dependabot bot and others added 6 commits November 16, 2023 09:04
Bumps the github-actions group with 1 update: [actions/cache](https://github.com/actions/cache).

- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the go-modules group with 1 update: [gorm.io/driver/postgres](https://github.com/go-gorm/postgres).

- [Commits](go-gorm/postgres@v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: gorm.io/driver/postgres
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
@kkumar-gcc kkumar-gcc marked this pull request as ready for review November 16, 2023 09:08
@kkumar-gcc kkumar-gcc marked this pull request as draft November 16, 2023 09:09
Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So beautiful test cases, just left a few questions. 👍

contracts/foundation/mocks/Application.go Outdated Show resolved Hide resolved
contracts/foundation/application.go Show resolved Hide resolved
// SetLocale set the current application locale.
SetLocale(ctx context.Context, locale string) context.Context
// SetLocaleByHttp set the current application/context locale by http request.
//SetLocaleByHttp(ctx http.Context, locale string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why remove this?

foundation/application.go Show resolved Hide resolved
translation/file_loader_test.go Outdated Show resolved Hide resolved
translation/file_loader.go Show resolved Hide resolved
translation/message_selector.go Outdated Show resolved Hide resolved
translation/message_selector.go Show resolved Hide resolved
translation/translator_test.go Outdated Show resolved Hide resolved
@kkumar-gcc
Copy link
Member Author

#350

@kkumar-gcc kkumar-gcc closed this Nov 16, 2023
@kkumar-gcc kkumar-gcc mentioned this pull request Nov 16, 2023
4 tasks
@devhaozi devhaozi deleted the kkumar-gcc/#39 branch January 16, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ [Feature] New Localization module
3 participants