https://github.com/atelierarith/docstringtranslationgoogletransbackend.jl
Translate Julia's docstring using Google Translate API
https://github.com/atelierarith/docstringtranslationgoogletransbackend.jl
julia julialang python translation translator
Last synced: 4 months ago
JSON representation
Translate Julia's docstring using Google Translate API
- Host: GitHub
- URL: https://github.com/atelierarith/docstringtranslationgoogletransbackend.jl
- Owner: AtelierArith
- License: other
- Created: 2024-11-21T06:11:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-18T08:32:21.000Z (over 1 year ago)
- Last Synced: 2025-09-09T13:45:49.781Z (10 months ago)
- Topics: julia, julialang, python, translation, translator
- Language: Julia
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DocstringTranslationGoogleTransBackend.jl
This package translates Julia's docstring in your native languages using Google Translate API to make calls to such methods as detect and translate. The idea is based on [henrik-wolf/LocalisedLiterals.jl](https://github.com/henrik-wolf/LocalisedLiterals.jl) repository.
## Setup
```julia
$ git clone https://github.com/AtelierArith/DocstringTranslationGoogleTransBackend.jl.git
$ cd DocstringTranslationGoogleTransBackend.jl
$ julia --project -e 'using Pkg; Pkg.instantiate()'
```
# Usage
Start Julia
```sh
$ cd path/to/this/directory
$ ls
Manifest.toml Project.toml README.md src
$ julia --project
```
This will launch a Julia REPL session. Then run the following commands in the Julia REPL session:
```julia
julia> using DocstringTranslationGoogleTransBackend
julia> @switchlang! :
julia> # Ask something
julia> @doc sin
```
## Example: Japanese(日本語)
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.2 (2024-12-01)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using DocstringTranslationGoogleTransBackend; @switchlang! :Japanese; @doc sin
sin(x)
x の正弦を計算します。x の単位はラジアンです。
sind、sinpi、sincos、cis、asin も参照してください。
Examples
≡≡≡≡≡≡≡≡
julia> round.(sin.(range(0, 2pi, length=9)'), digits=3)
1×9 Matrix{Float64}:
0.0 0.707 1.0 0.707 0.0 -0.707 -1.0 -0.707 -0.0
julia> sind(45)
0.7071067811865476
julia> sinpi(1/4)
0.7071067811865475
julia> round.(sincos(pi/6), digits=3)
(0.5, 0.866)
julia> round(cis(pi/6), digits=3)
0.866 + 0.5im
julia> round(exp(im*pi/6), digits=3)
0.866 + 0.5im
sin(A::AbstractMatrix)
正方行列 ``A`` の行列正弦を計算します。
A が対称またはエルミートの場合、その固有分解 (eigen)
を使用してサインが計算されます。それ以外の場合、正弦は exp
を呼び出すことによって決定されます。
Examples
≡≡≡≡≡≡≡≡
julia> sin(fill(1.0, (2,2)))
2×2 Matrix{Float64}:
0.454649 0.454649
0.454649 0.454649
julia>
```
## Example: German(ドイツ語)
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.2 (2024-12-01)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using DocstringTranslationGoogleTransBackend; @switchlang! :German; @doc sin
sin(x)
Berechnen Sie den Sinus von „x“, wobei „x“ im Bogenmaß angegeben ist.
Siehe auch „sind“, „sinpi“, „sincos“, „cis“, „asin“.
Examples
≡≡≡≡≡≡≡≡
julia> round.(sin.(range(0, 2pi, length=9)'), digits=3)
1×9 Matrix{Float64}:
0.0 0.707 1.0 0.707 0.0 -0.707 -1.0 -0.707 -0.0
julia> sind(45)
0.7071067811865476
julia> sinpi(1/4)
0.7071067811865475
julia> round.(sincos(pi/6), digits=3)
(0.5, 0.866)
julia> round(cis(pi/6), digits=3)
0.866 + 0.5im
julia> round(exp(im*pi/6), digits=3)
0.866 + 0.5im
sin(A::AbstractMatrix)
Berechnen Sie den Matrixsinus einer quadratischen Matrix „A“.
Wenn „A“ symmetrisch oder hermitesch ist, wird seine Eigenzerlegung
(„eigen“) zur Berechnung des Sinus verwendet. Andernfalls wird der Sinus
durch den Aufruf von „exp“ ermittelt.
Examples
≡≡≡≡≡≡≡≡
julia> sin(fill(1.0, (2,2)))
2×2 Matrix{Float64}:
0.454649 0.454649
0.454649 0.454649
julia>
```
## French(フランス語)
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.1 (2024-10-16)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using DocstringTranslationGoogleTransBackend; @switchlang! :French; @doc sin
sin(x)
Calculez le sinus de x. Les unités de `x` sont les radians.
Voir aussi `sind`, `sinpi`, `sincos`, `cis`, `asin `.
Examples
≡≡≡≡≡≡≡≡
julia> round.(sin.(range(0, 2pi, length=9)'), digits=3)
1×9 Matrix{Float64}:
0.0 0.707 1.0 0.707 0.0 -0.707 -1.0 -0.707 -0.0
julia> sind(45)
0.7071067811865476
julia> sinpi(1/4)
0.7071067811865475
julia> round.(sincos(pi/6), digits=3)
(0.5, 0.866)
julia> round(cis(pi/6), digits=3)
0.866 + 0.5im
julia> round(exp(im*pi/6), digits=3)
0.866 + 0.5im
sin(A::AbstractMatrix)
Calcule le sinus de la matrice carrée ``A``.
Si `A` est symétrique ou hermitien, sa décomposition propre (`eigen`) est
utilisée pour calculer le sinus. Sinon, le sinus est déterminé en
appelant exp.
Examples
≡≡≡≡≡≡≡≡
julia> sin(fill(1.0, (2,2)))
2×2 Matrix{Float64}:
0.454649 0.454649
0.454649 0.454649
julia>
```