Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
i18n: move the code file into internal (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhan005 authored Nov 27, 2020
1 parent 7041f3d commit 21854fb
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"os"
"time"

"github.com/vidar-team/Cardinal/internal/locales"
log "unknwon.dev/clog/v2"

"github.com/BurntSushi/toml"
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/locales"
)

var conf *config
Expand Down
2 changes: 1 addition & 1 deletion internal/asteroid/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package asteroid

import (
"github.com/gin-gonic/gin"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

func GetAsteroidStatus(c *gin.Context) (int, interface{}) {
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/jinzhu/gorm"
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// ManagerLogin is manager login handler.
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package auth
import (
"github.com/gin-gonic/gin"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// TeamAuthRequired is the team permission check middleware.
Expand Down
5 changes: 3 additions & 2 deletions internal/auth/team/team.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package team

import (
"strconv"

"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
"strconv"
)

// TeamLogin is the team login handler.
Expand Down
2 changes: 1 addition & 1 deletion internal/bulletin/bulletin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// GetAllBulletins returns all bulletins from the database.
Expand Down
2 changes: 1 addition & 1 deletion internal/db/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/locales"
"github.com/vidar-team/Cardinal/internal/locales"
log "unknwon.dev/clog/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/dynamic_config/dynamic_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package dynamic_config
import (
"github.com/gin-gonic/gin"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

func Init() {
Expand Down
2 changes: 1 addition & 1 deletion internal/game/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// SetVisible is setting challenge visible status handler.
Expand Down
2 changes: 1 addition & 1 deletion internal/game/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"github.com/vidar-team/Cardinal/internal/asteroid"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/livelog"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/misc/webhook"
"github.com/vidar-team/Cardinal/internal/timer"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// CheckDown is the gamebox check down handler for bots.
Expand Down
2 changes: 1 addition & 1 deletion internal/game/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/dynamic_config"
"github.com/vidar-team/Cardinal/internal/livelog"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/misc/webhook"
"github.com/vidar-team/Cardinal/internal/timer"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// SubmitFlag is submit flag handler for teams.
Expand Down
2 changes: 1 addition & 1 deletion internal/game/gamebox.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/jinzhu/gorm"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/dynamic_config"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/timer"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

// GetSelfGameBoxes returns the gameboxes which belong to the team.
Expand Down
2 changes: 1 addition & 1 deletion internal/game/rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"github.com/patrickmn/go-cache"
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/store"
"github.com/vidar-team/Cardinal/locales"
)

// RankItem is used to create the ranking list.
Expand Down
2 changes: 1 addition & 1 deletion internal/game/score.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/healthy"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/locales"
)

// CalculateRoundScore will calculate the score of the given round.
Expand Down
2 changes: 1 addition & 1 deletion internal/healthy/healthy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/timer"
"github.com/vidar-team/Cardinal/locales"
)

// HealthyCheck will be used to check whether Cardinal runs normally.
Expand Down
2 changes: 1 addition & 1 deletion internal/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
log "unknwon.dev/clog/v2"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/misc/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (

"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/dynamic_config"
"github.com/vidar-team/Cardinal/internal/locales"
log "unknwon.dev/clog/v2"

"github.com/gin-gonic/gin"
"github.com/parnurzeal/gorequest"
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

const GITHUB_RELEASE_API = "https://api.github.com/repos/vidar-team/Cardinal/releases/latest"
Expand Down
2 changes: 1 addition & 1 deletion internal/misc/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/patrickmn/go-cache"
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/internal/db"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/store"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/route/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
"github.com/vidar-team/Cardinal/internal/game"
"github.com/vidar-team/Cardinal/internal/healthy"
"github.com/vidar-team/Cardinal/internal/livelog"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/misc/webhook"
"github.com/vidar-team/Cardinal/internal/timer"
"github.com/vidar-team/Cardinal/internal/upload"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

func Init() *gin.Engine {
Expand Down
2 changes: 1 addition & 1 deletion internal/timer/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"github.com/gin-gonic/gin"
"github.com/vidar-team/Cardinal/conf"
"github.com/vidar-team/Cardinal/internal/asteroid"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/logger"
"github.com/vidar-team/Cardinal/internal/misc/webhook"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
log "unknwon.dev/clog/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/upload/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/gin-gonic/gin"
"github.com/thanhpk/randstr"
"github.com/vidar-team/Cardinal/internal/locales"
"github.com/vidar-team/Cardinal/internal/utils"
"github.com/vidar-team/Cardinal/locales"
)

func GetDir(c *gin.Context) (int, interface{}) {
Expand Down

0 comments on commit 21854fb

Please sign in to comment.