0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-09 03:21:45 +01:00
gitea/templates/package/content/maven.tmpl
wxiaoguang 98088befae
Fix broken translations for package documantion (#25742)
The code was just copied&pasted, it causes problems now.

There are a lot (for every package) broken translations. eg:

```
# en-US
conda.documentation = For more information on the Conda registry, see 
<a target="_blank" rel="noopener noreferrer" href="%s">the documentation</a>.

# fr-FR (and many languages)
conda.documentation=Pour plus d'informations sur le registre Conda, voir 
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/fr-fr/packages/conda/">la documentation</a>.
```


To resolve the problem fundamentally, use a general string, and trigger
the re-translating on Crowdin side.


And, it should really really really avoid introducing too much
copied&pasted code .......
2023-07-07 10:47:26 +02:00

71 lines
3.2 KiB
Handlebars

{{if eq .PackageDescriptor.Package.Type "maven"}}
<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
<div class="ui attached segment">
<div class="ui form">
<div class="field">
<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.registry" | Safe}}</label>
<div class="markup"><pre class="code-block"><code>&lt;repositories&gt;
&lt;repository&gt;
&lt;id&gt;gitea&lt;/id&gt;
&lt;url&gt;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url>&lt;/url&gt;
&lt;/repository&gt;
&lt;/repositories&gt;
&lt;distributionManagement&gt;
&lt;repository&gt;
&lt;id&gt;gitea&lt;/id&gt;
&lt;url&gt;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url>&lt;/url&gt;
&lt;/repository&gt;
&lt;snapshotRepository&gt;
&lt;id&gt;gitea&lt;/id&gt;
&lt;url&gt;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url>&lt;/url&gt;
&lt;/snapshotRepository&gt;
&lt;/distributionManagement&gt;</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.install" | Safe}}</label>
<div class="markup"><pre class="code-block"><code>&lt;dependency&gt;
&lt;groupId&gt;{{.PackageDescriptor.Metadata.GroupID}}&lt;/groupId&gt;
&lt;artifactId&gt;{{.PackageDescriptor.Metadata.ArtifactID}}&lt;/artifactId&gt;
&lt;version&gt;{{.PackageDescriptor.Version.Version}}&lt;/version&gt;
&lt;/dependency&gt;</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.install2"}}</label>
<div class="markup"><pre class="code-block"><code>mvn install</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.download"}}</label>
<div class="markup"><pre class="code-block"><code>mvn dependency:get -DremoteRepositories=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url> -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}</code></pre></div>
</div>
<div class="field">
<label>{{.locale.Tr "packages.registry.documentation" "Maven" "https://docs.gitea.io/en-us/usage/packages/maven/" | Safe}}</label>
</div>
</div>
</div>
{{if .PackageDescriptor.Metadata.Description}}
<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
<div class="ui attached segment">
{{.PackageDescriptor.Metadata.Description}}
</div>
{{end}}
{{if .PackageDescriptor.Metadata.Dependencies}}
<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
<div class="ui attached segment">
<div class="ui list">
{{range .PackageDescriptor.Metadata.Dependencies}}
<div class="item">
<i class="icon">{{svg "octicon-package-dependencies" 16 ""}}</i>
<div class="content">
<div class="header">{{.GroupID}}:{{.ArtifactID}}</div>
<div class="description text small">{{.Version}}</div>
</div>
</div>
{{end}}
</div>
</div>
{{end}}
{{end}}