Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/content/doc/installation/with-docker.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ services:

## Databases

### SQLite3 database

Use the above "basic" docker-compose config, set "Database Type" to SQLite3 on the installation page.

SQLite3 is only suitable for small instance and for only a few users.
It's recommended to use other database servers for production instances.

### MySQL database

To start Gitea in combination with a MySQL database, apply these changes to the
Expand Down
11 changes: 10 additions & 1 deletion modules/web/middleware/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale {
// 1. Check URL arguments.
lang := req.URL.Query().Get("lang")
changeLang := lang != ""
skipHandler := req.URL.Query().Get("lang_skip_handler") != ""

// 2. Get language information from cookies.
if len(lang) == 0 {
Expand Down Expand Up @@ -46,7 +47,15 @@ func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale {
SetLocaleCookie(resp, lang, 1<<31-1)
}

return translation.NewLocale(lang)
err := translation.NewLocale(lang)
if err != nil {
return err
}

if skipHandler {
resp.WriteHeader(http.StatusNoContent)
}
return nil
}

// SetLocaleCookie convenience function to set the locale cookie consistently
Expand Down
2 changes: 1 addition & 1 deletion routers/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func Install(ctx *context.Context) {
}
}
if !isCurDBTypeSupported {
curDBType = "mysql"
curDBType = setting.SupportedDatabaseTypes[0]
}
ctx.Data["CurDbType"] = curDBType

Expand Down
7 changes: 5 additions & 2 deletions web_src/js/features/common-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ export function initHeadNavbarContentToggle() {

export function initFootLanguageMenu() {
function linkLanguageAction() {
const $this = $(this);
$.post($this.data('url')).always(() => {
let changeLangUrl = $(this).attr('data-url');
changeLangUrl += changeLangUrl.includes('?') ? '&' : '?';
// Only use "lang_skip_handler" for ajax. Page links should not have this parameter because crawlers need to get the full page
changeLangUrl += 'lang_skip_handler=1';
$.get(changeLangUrl).always(() => {
window.location.reload();
});
}
Expand Down