chore(i18n): deduplicate common packages related strings (#11345)

Our package registries types have many things in common, so they have many shared strings like
```json
"packages.installation": "Installation",
```

but not all and not consistently. For example, some packages duplicate these strings:
```json
"packages.*.install": "To install the package, run the following command:",
"packages.*.registry": "Setup this registry from the command line:",
"packages.*.repository": "Repository info",
"packages.*.dependencies": "Dependencies",
```

while other packages have them customized:
```json
"packages.cargo.install": "To install the package using Cargo, run the following command:",
"packages.composer.install": "To install the package using Composer, run the following command:",
"packages.conan.install": "To install the package using Conan, run the following command:",
"packages.conda.install": "To install the package using Conda, run the following command:",
```

While it's ok for them to have custom strings, I don't see need to duplicate the same generic strings. Even though Weblate provides tools to simplify maintenance of duplicated strings, our files still end up being bloated.

In this PR I deduplicated the strings listed above under a `common` key. There already was a generic shared string for Dependencies, that I just re-used.

Also fixed strings in Arch packages, which were saying Depends with meaning of Dependencies.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11345
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
0ko 2026-02-18 04:07:14 +01:00
parent 149f9a9ba9
commit 8c2bb0f65b
14 changed files with 27 additions and 45 deletions

View file

@ -271,11 +271,12 @@
"packages.dependency.id": "ID",
"packages.dependency.version": "Version",
"packages.search_in_external_registry": "Search in %s",
"packages.common.install": "To install the package, run the following command:",
"packages.common.registry": "Setup this registry from the command line:",
"packages.common.repository": "Repository info",
"packages.alpine.registry": "Setup this registry by adding the url in your <code>/etc/apk/repositories</code> file:",
"packages.alpine.registry.key": "Download the registry public RSA key into the <code>/etc/apk/keys/</code> folder to verify the index signature:",
"packages.alpine.registry.info": "Choose $branch and $repository from the list below.",
"packages.alpine.install": "To install the package, run the following command:",
"packages.alpine.repository": "Repository info",
"packages.alpine.repository.branches": "Branches",
"packages.alpine.repository.repositories": "Repositories",
"packages.alpine.repository.architectures": "Architectures",
@ -288,22 +289,18 @@
"packages.arch.version.description": "Description",
"packages.arch.version.provides": "Provides",
"packages.arch.version.groups": "Group",
"packages.arch.version.depends": "Depends",
"packages.arch.version.optdepends": "Optional depends",
"packages.arch.version.makedepends": "Make depends",
"packages.arch.version.checkdepends": "Check depends",
"packages.arch.version.optdepends": "Optional dependencies",
"packages.arch.version.makedepends": "Make dependencies",
"packages.arch.version.checkdepends": "Check dependencies",
"packages.arch.version.conflicts": "Conflicts",
"packages.arch.version.replaces": "Replaces",
"packages.arch.version.backup": "Backup",
"packages.cargo.registry": "Setup this registry in the Cargo configuration file (for example <code>~/.cargo/config.toml</code>):",
"packages.cargo.install": "To install the package using Cargo, run the following command:",
"packages.chef.registry": "Setup this registry in your <code>~/.chef/config.rb</code> file:",
"packages.chef.install": "To install the package, run the following command:",
"packages.composer.registry": "Setup this registry in your <code>~/.composer/config.json</code> file:",
"packages.composer.install": "To install the package using Composer, run the following command:",
"packages.composer.dependencies": "Dependencies",
"packages.composer.dependencies.development": "Development dependencies",
"packages.conan.registry": "Setup this registry from the command line:",
"packages.conan.install": "To install the package using Conan, run the following command:",
"packages.conda.registry": "Setup this registry as a Conda repository in your <code>.condarc</code> file:",
"packages.conda.install": "To install the package using Conda, run the following command:",
@ -318,29 +315,21 @@
"packages.container.labels.key": "Key",
"packages.container.labels.value": "Value",
"packages.cran.registry": "Setup this registry in your <code>Rprofile.site</code> file:",
"packages.cran.install": "To install the package, run the following command:",
"packages.debian.registry": "Setup this registry from the command line:",
"packages.debian.registry.info": "Choose $distribution and $component from the list below.",
"packages.debian.install": "To install the package, run the following command:",
"packages.debian.repository": "Repository info",
"packages.debian.repository.distributions": "Distributions",
"packages.debian.repository.components": "Components",
"packages.debian.repository.architectures": "Architectures",
"packages.generic.download": "Download package from the command line:",
"packages.go.install": "Install the package from the command line:",
"packages.helm.registry": "Setup this registry from the command line:",
"packages.helm.install": "To install the package, run the following command:",
"packages.maven.registry": "Setup this registry in your project <code>pom.xml</code> file:",
"packages.maven.install": "To use the package include the following in the <code>dependencies</code> block in the <code>pom.xml</code> file:",
"packages.maven.install2": "Run via command line:",
"packages.maven.download": "To download the dependency, run via command line:",
"packages.nuget.registry": "Setup this registry from the command line:",
"packages.nuget.install": "To install the package using NuGet, run the following command:",
"packages.nuget.dependency.framework": "Target Framework",
"packages.npm.registry": "Setup this registry in your project <code>.npmrc</code> file:",
"packages.npm.install": "To install the package using npm, run the following command:",
"packages.npm.install2": "or add it to the package.json file:",
"packages.npm.dependencies": "Dependencies",
"packages.npm.dependencies.development": "Development dependencies",
"packages.npm.dependencies.bundle": "Bundled dependencies",
"packages.npm.dependencies.peer": "Peer dependencies",
@ -348,18 +337,12 @@
"packages.npm.details.tag": "Tag",
"packages.pypi.requires": "Requires Python",
"packages.pypi.install": "To install the package using pip, run the following command:",
"packages.rpm.registry": "Setup this registry from the command line:",
"packages.rpm.distros.redhat": "on RedHat based distributions",
"packages.rpm.distros.suse": "on SUSE based distributions",
"packages.rpm.install": "To install the package, run the following command:",
"packages.rpm.repository": "Repository info",
"packages.rpm.repository.architectures": "Architectures",
"packages.rpm.repository.multiple_groups": "This package is available in multiple groups.",
"packages.alt.registry": "Setup this registry from the command line:",
"packages.alt.registry.install": "To install the package, run the following command:",
"packages.alt.install": "Install package",
"packages.alt.setup": "Add a repository to the list of connected repositories (choose the necessary architecture instead of \"_arch_\"):",
"packages.alt.repository": "Repository info",
"packages.alt.repository.architectures": "Architectures",
"packages.alt.repository.multiple_groups": "This package is available in multiple groups.",
"packages.rubygems.install": "To install the package using gem, run the following command:",
@ -368,7 +351,6 @@
"packages.rubygems.dependencies.development": "Development dependencies",
"packages.rubygems.required.ruby": "Requires Ruby version",
"packages.rubygems.required.rubygems": "Requires RubyGem version",
"packages.swift.registry": "Setup this registry from the command line:",
"packages.swift.install": "Add the package in your <code>Package.swift</code> file:",
"packages.swift.install2": "and run the following command:",
"packages.vagrant.install": "To add a Vagrant box, run the following command:",

View file

@ -12,7 +12,7 @@
<div class="markup"><pre class="code-block"><code>curl -JO <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine/key"></origin-url></code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup">
<pre class="code-block"><code>sudo apk add {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre>
</div>
@ -23,7 +23,7 @@
</div>
</div>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.alpine.repository"}}</h4>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.common.repository"}}</h4>
<div class="ui attached segment">
<table class="ui single line very basic table">
<tbody>

View file

@ -3,7 +3,7 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alt.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>{{- if gt (len .Groups) 1 -}}
# {{ctx.Locale.Tr "packages.alt.repository.multiple_groups"}}
@ -18,7 +18,7 @@ apt-repo add rpm <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDes
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alt.install"}}</label>
<div class="markup">
<pre class="code-block"><code># {{ctx.Locale.Tr "packages.alt.registry.install"}}
<pre class="code-block"><code># {{ctx.Locale.Tr "packages.common.install"}}
apt-get update
apt-get install {{$.PackageDescriptor.Package.Name}}</code></pre>
</div>
@ -29,7 +29,7 @@ apt-get install {{$.PackageDescriptor.Package.Name}}</code></pre>
</div>
</div>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.alt.repository"}}</h4>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.common.repository"}}</h4>
<div class="ui attached segment">
<table class="ui single line very basic table">
<tbody>

View file

@ -77,7 +77,7 @@ Server = <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.
{{if .PackageDescriptor.Metadata.Depends}}
<tr>
<td class="collapsing">
<h5>{{ctx.Locale.Tr "packages.arch.version.depends"}}</h5>
<h5>{{ctx.Locale.Tr "packages.dependencies"}}</h5>
</td>
<td>{{StringUtils.Join $.PackageDescriptor.Metadata.Depends ", "}}</td>
</tr>

View file

@ -7,7 +7,7 @@
<div class="markup"><pre class="code-block"><code>knife[:supermarket_site] = '<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/chef"></origin-url>'</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.chef.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup"><pre class="code-block"><code>knife supermarket install {{.PackageDescriptor.Package.Name}} {{.PackageDescriptor.Version.Version}}</code></pre></div>
</div>
<div class="field">

View file

@ -33,7 +33,7 @@
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
<div class="ui attached segment">
<div class="ui list">
{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (ctx.Locale.Tr "packages.composer.dependencies")}}
{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (ctx.Locale.Tr "packages.dependencies")}}
{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RequireDev "title" (ctx.Locale.Tr "packages.composer.dependencies.development")}}
</div>
</div>

View file

@ -3,7 +3,7 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>conan remote add forgejo <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conan"></origin-url></code></pre></div>
</div>
<div class="field">

View file

@ -7,7 +7,7 @@
<div class="markup"><pre class="code-block"><code>options("repos" = c(getOption("repos"), c(forgejo="<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cran"></origin-url>")))</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cran.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup"><pre class="code-block"><code>install.packages("{{.PackageDescriptor.Package.Name}}")</code></pre></div>
</div>
<div class="field">

View file

@ -3,14 +3,14 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>sudo curl <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian/repository.key"></origin-url> -o /etc/apt/keyrings/forgejo-{{$.PackageDescriptor.Owner.Name}}.asc
echo "deb [signed-by=/etc/apt/keyrings/forgejo-{{$.PackageDescriptor.Owner.Name}}.asc] <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian"></origin-url> $distribution $component" | sudo tee -a /etc/apt/sources.list.d/forgejo.list
sudo apt update</code></pre></div>
<p>{{ctx.Locale.Tr "packages.debian.registry.info"}}</p>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup">
<pre class="code-block"><code>sudo apt install {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre>
</div>
@ -21,7 +21,7 @@ sudo apt update</code></pre></div>
</div>
</div>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.debian.repository"}}</h4>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.common.repository"}}</h4>
<div class="ui attached segment">
<table class="ui single line very basic table">
<tbody>

View file

@ -3,12 +3,12 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>helm repo add {{AppDomain}} <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/helm"></origin-url>
helm repo update</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup"><pre class="code-block"><code>helm install {{.PackageDescriptor.Package.Name}} {{AppDomain}}/{{.PackageDescriptor.Package.Name}}</code></pre></div>
</div>
<div class="field">

View file

@ -37,7 +37,7 @@
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
<div class="ui attached segment">
<div class="ui list">
{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (ctx.Locale.Tr "packages.npm.dependencies")}}
{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (ctx.Locale.Tr "packages.dependencies")}}
{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.development")}}
{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.PeerDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.peer")}}
{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.OptionalDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.optional")}}

View file

@ -3,7 +3,7 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.nuget.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json"></origin-url></code></pre></div>
</div>
<div class="field">

View file

@ -3,7 +3,7 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>{{- if gt (len .Groups) 1 -}}
# {{ctx.Locale.Tr "packages.rpm.repository.multiple_groups"}}
@ -21,7 +21,7 @@ zypper addrepo <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescr
{{- end}}</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.install"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.install"}}</label>
<div class="markup">
<pre class="code-block"><code># {{ctx.Locale.Tr "packages.rpm.distros.redhat"}}
dnf install {{$.PackageDescriptor.Package.Name}}
@ -36,7 +36,7 @@ zypper install {{$.PackageDescriptor.Package.Name}}</code></pre>
</div>
</div>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.rpm.repository"}}</h4>
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.common.repository"}}</h4>
<div class="ui attached segment">
<table class="ui single line very basic table">
<tbody>

View file

@ -3,7 +3,7 @@
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.swift.registry"}}</label>
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.common.registry"}}</label>
<div class="markup"><pre class="code-block"><code>swift package-registry set <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/swift"></origin-url></code></pre></div>
</div>
<div class="field">