fix missing lang strings

This commit is contained in:
partisan 2024-10-09 21:03:53 +02:00
parent 2757fc8d80
commit 2f347bb759
10 changed files with 19 additions and 20 deletions

View file

@ -55,8 +55,8 @@ msgstr "Safe Search On"
msgid "save_settings"
msgstr "Save settings"
msgid "page_title"
msgstr "Search results for '%s'"
msgid "all_settings"
msgstr "All settings"
msgid "site_name"
msgstr "Ocásek"

View file

@ -55,8 +55,8 @@ msgstr "Włączony filtr"
msgid "save_settings"
msgstr "Zapisz ustawienia"
msgid "page_title"
msgstr "Wyniki wyszukiwania dla '%s'"
msgid "all_settings"
msgstr "Wszystkie ustawienia"
msgid "site_name"
msgstr "Ocásek"

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/style-fixedwidth.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ translate "site_name" }} - {{ .Query }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "search_page_title" }}</title>
<title>{{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/style-search.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
@ -74,7 +74,7 @@
<div class="settings-content">
<button id="settingsButton" onclick="window.location.href='/settings'">{{ translate "all_settings" }}</button> <!-- Well its unessesary to use js here but this menu will not work without js anyway -->
<div class="theme-settings theme-mini-settings">
<p><span class="highlight">{{ translate "current_theme" }}: </span> <span id="theme_name">{{.Theme}}</span></p>
<p><span class="highlight">{{ translate "theme" }}: </span> <span id="theme_name">{{.Theme}}</span></p>
<div class="themes-settings-menu">
<div><img class="view-image-search clickable" id="dark_theme" alt="{{ translate "dark_theme" }}" src="/static/images/dark.webp"></div>
<div><img class="view-image-search clickable" id="light_theme" alt="{{ translate "light_theme" }}" src="/static/images/light.webp"></div>

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">

View file

@ -6,7 +6,7 @@
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ translate "page_title" .Query }}</title>
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">

View file

@ -65,25 +65,24 @@ func buildSearchURL(query, safe, lang string, page, resultsPerPage int) string {
}
langParam := ""
var glParam, uuleParam string
var glParam string
if lang != "" {
// Use lang as the geolocation
langParam = "&lr=lang_" + lang
glParam = "&gl=" + lang
uuleParam = ""
} else {
// Use random geolocation
glParam, uuleParam = "us", "us"
// Use default geolocation
glParam = "&gl=us"
}
startIndex := (page - 1) * resultsPerPage
printDebug(fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s%s&start=%d",
url.QueryEscape(query), safeParam, langParam, glParam, uuleParam, startIndex))
printDebug(fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s&start=%d",
url.QueryEscape(query), safeParam, langParam, glParam, startIndex))
return fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s%s&start=%d",
url.QueryEscape(query), safeParam, langParam, glParam, uuleParam, startIndex)
return fmt.Sprintf("https://www.google.com/search?q=%s%s%s%s&start=%d",
url.QueryEscape(query), safeParam, langParam, glParam, startIndex)
}
// func getRandomGeoLocation() (string, string) {