Skip to content

Translation sync. #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 30 additions & 5 deletions lang/es-es/typeshed/stdlib/microbit/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Pines, imágenes, sonidos, temperatura y volumen."""
from typing import Any, Callable, List, Optional, Tuple, overload
from typing import Any, Callable, List, Optional, Tuple, Union, overload
from _typeshed import ReadableBuffer
from . import accelerometer as accelerometer
from . import audio as audio
Expand Down Expand Up @@ -55,14 +55,39 @@ Requires restart."""
def reset() -> None:
"""Reiniciar la placa. (restablecer)"""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[int, int]) -> int:
"""Converts a value from a range to an integer range.

Example: ``volume = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))``

For example, to convert an accelerometer X value to a speaker volume.

If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.

temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))

:param value: (valor) A number to convert.
:param from_: A tuple to define the range to convert from.
:param to: A tuple to define the range to convert to.
:return: The ``value`` converted to the ``to`` range."""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[float, float]) -> float:
"""Converts a value from a range to another range.
"""Converts a value from a range to a floating point range.

Example: ``temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))``

Example: ``temp_fahrenheit = scale(30, from_=(0, 100), to=(32, 212))``
For example, to convert temperature from a Celsius scale to Fahrenheit.

This can be useful to convert values between inputs and outputs, for example an accelerometer X value to a speaker volume.
If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.
If they are both integers (i.e ``10``), it will return an integer::

Negative scaling is also supported, for example ``scale(25, from_=(0, 100), to=(0, -200))`` will return ``-50``.
returns_int = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))

:param value: (valor) A number to convert.
:param from_: A tuple to define the range to convert from.
Expand Down
8 changes: 4 additions & 4 deletions lang/es-es/typeshed/stdlib/music.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Crear y reproducir melodías. (música)"""
from typing import Tuple, Union, List
from typing import Optional, Tuple, Union, List
from .microbit import MicroBitDigitalPin, pin0
DADADADUM: Tuple[str, ...]
"""Melodía: apertura de la "Sinfonía n.º 5 en do menor" de Beethoven."""
Expand Down Expand Up @@ -79,7 +79,7 @@ Example: ``ticks, beats = music.get_tempo()``
:return: The temp as a tuple with two integer values, the ticks then the beats per minute."""
...

def play(music: Union[str, List[str], Tuple[str, ...]], pin: Union[MicroBitDigitalPin, None]=pin0, wait: bool=True, loop: bool=False) -> None:
def play(music: Union[str, List[str], Tuple[str, ...]], pin: Optional[MicroBitDigitalPin]=pin0, wait: bool=True, loop: bool=False) -> None:
"""Reproduce música. (reproducir)

Example: ``music.play(music.NYAN)``
Expand All @@ -92,7 +92,7 @@ Example: ``music.play(music.NYAN)``
Many built-in melodies are defined in this module."""
...

def pitch(frequency: int, duration: int=-1, pin: MicroBitDigitalPin=pin0, wait: bool=True) -> None:
def pitch(frequency: int, duration: int=-1, pin: Optional[MicroBitDigitalPin]=pin0, wait: bool=True) -> None:
"""Reproduce una nota. (tono)

Example: ``music.pitch(185, 1000)``
Expand All @@ -108,7 +108,7 @@ For example, if the frequency is set to 440 and the length to
You can only play one pitch on one pin at any one time."""
...

def stop(pin: MicroBitDigitalPin=pin0) -> None:
def stop(pin: Optional[MicroBitDigitalPin]=pin0) -> None:
"""Detiene la reproducción de toda la música en el altavoz integrado y en cualquier pin que esté emitiendo sonido. (detener)

Example: ``music.stop()``
Expand Down
11 changes: 8 additions & 3 deletions lang/es-es/typeshed/stdlib/power.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ def deep_sleep(

Example: ``power.deep_sleep(wake_on=(button_a, button_b))``

The program state is preserved and when it wakes up it will resume operation where it left off.
The program state is preserved and when it wakes up it will resume
operation where it left off.

Deep Sleep mode will consume more battery power than Off mode.

The wake up sources are configured via arguments.

If no wake up sources have been configured it will sleep until the reset button is pressed (which resets the Target MCU) or, in battery power, when the USB cable is inserted.
The board will always wake up when receiving UART data, when the reset
button is pressed (which resets the board) or, in battery power,
when the USB cable is inserted.

When the ``run_every`` parameter is set to ``True`` (the default), any function scheduled with ``microbit.run_every`` will still run while the board sleeps. When the scheduled time is reached the micro:bit will momentarily wake up to run the scheduled function and then automatically go back to sleep.
When the ``run_every`` parameter is set to ``True`` (the default), any
function scheduled with ``run_every`` will momentarily wake up the board
to run and when it finishes it will go back to sleep.

:param ms: A time in milliseconds to wait before it wakes up.
:param wake_on: A single instance or a tuple of pins and/or buttons to wake up the board, e.g. ``deep_sleep(wake_on=button_a)`` or ``deep_sleep(wake_on=(pin0, pin2, button_b))``.
Expand Down
35 changes: 30 additions & 5 deletions lang/fr/typeshed/stdlib/microbit/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Broches, images, sons, température et volume"""
from typing import Any, Callable, List, Optional, Tuple, overload
from typing import Any, Callable, List, Optional, Tuple, Union, overload
from _typeshed import ReadableBuffer
from . import accelerometer as accelerometer
from . import audio as audio
Expand Down Expand Up @@ -55,14 +55,39 @@ Requires restart."""
def reset() -> None:
"""Redémarrer la carte."""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[int, int]) -> int:
"""Converts a value from a range to an integer range.

Example: ``volume = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))``

For example, to convert an accelerometer X value to a speaker volume.

If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.

temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))

:param value: A number to convert.
:param from_: A tuple to define the range to convert from.
:param to: A tuple to define the range to convert to.
:return: The ``value`` converted to the ``to`` range."""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[float, float]) -> float:
"""Converts a value from a range to another range.
"""Converts a value from a range to a floating point range.

Example: ``temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))``

Example: ``temp_fahrenheit = scale(30, from_=(0, 100), to=(32, 212))``
For example, to convert temperature from a Celsius scale to Fahrenheit.

This can be useful to convert values between inputs and outputs, for example an accelerometer X value to a speaker volume.
If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.
If they are both integers (i.e ``10``), it will return an integer::

Negative scaling is also supported, for example ``scale(25, from_=(0, 100), to=(0, -200))`` will return ``-50``.
returns_int = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))

:param value: A number to convert.
:param from_: A tuple to define the range to convert from.
Expand Down
8 changes: 4 additions & 4 deletions lang/fr/typeshed/stdlib/music.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Créer et jouer des mélodies."""
from typing import Tuple, Union, List
from typing import Optional, Tuple, Union, List
from .microbit import MicroBitDigitalPin, pin0
DADADADUM: Tuple[str, ...]
"""Mélodie : l'ouverture de la 5e symphonie en do mineur de Beethoven."""
Expand Down Expand Up @@ -79,7 +79,7 @@ Example: ``ticks, beats = music.get_tempo()``
:return: The temp as a tuple with two integer values, the ticks then the beats per minute."""
...

def play(music: Union[str, List[str], Tuple[str, ...]], pin: Union[MicroBitDigitalPin, None]=pin0, wait: bool=True, loop: bool=False) -> None:
def play(music: Union[str, List[str], Tuple[str, ...]], pin: Optional[MicroBitDigitalPin]=pin0, wait: bool=True, loop: bool=False) -> None:
"""Jouer de la musique.

Example: ``music.play(music.NYAN)``
Expand All @@ -92,7 +92,7 @@ Example: ``music.play(music.NYAN)``
Many built-in melodies are defined in this module."""
...

def pitch(frequency: int, duration: int=-1, pin: MicroBitDigitalPin=pin0, wait: bool=True) -> None:
def pitch(frequency: int, duration: int=-1, pin: Optional[MicroBitDigitalPin]=pin0, wait: bool=True) -> None:
"""Jouer une note. (tangage)

Example: ``music.pitch(185, 1000)``
Expand All @@ -108,7 +108,7 @@ For example, if the frequency is set to 440 and the length to
You can only play one pitch on one pin at any one time."""
...

def stop(pin: MicroBitDigitalPin=pin0) -> None:
def stop(pin: Optional[MicroBitDigitalPin]=pin0) -> None:
"""Met fin à toute lecture de musique sur le haut-parleur intégré et à tout son en sortie sur la broche.

Example: ``music.stop()``
Expand Down
11 changes: 8 additions & 3 deletions lang/fr/typeshed/stdlib/power.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ def deep_sleep(

Example: ``power.deep_sleep(wake_on=(button_a, button_b))``

The program state is preserved and when it wakes up it will resume operation where it left off.
The program state is preserved and when it wakes up it will resume
operation where it left off.

Deep Sleep mode will consume more battery power than Off mode.

The wake up sources are configured via arguments.

If no wake up sources have been configured it will sleep until the reset button is pressed (which resets the Target MCU) or, in battery power, when the USB cable is inserted.
The board will always wake up when receiving UART data, when the reset
button is pressed (which resets the board) or, in battery power,
when the USB cable is inserted.

When the ``run_every`` parameter is set to ``True`` (the default), any function scheduled with ``microbit.run_every`` will still run while the board sleeps. When the scheduled time is reached the micro:bit will momentarily wake up to run the scheduled function and then automatically go back to sleep.
When the ``run_every`` parameter is set to ``True`` (the default), any
function scheduled with ``run_every`` will momentarily wake up the board
to run and when it finishes it will go back to sleep.

:param ms: A time in milliseconds to wait before it wakes up.
:param wake_on: A single instance or a tuple of pins and/or buttons to wake up the board, e.g. ``deep_sleep(wake_on=button_a)`` or ``deep_sleep(wake_on=(pin0, pin2, button_b))``.
Expand Down
12 changes: 6 additions & 6 deletions lang/ja/typeshed/stdlib/log.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ present, it will generate a new header row with the additional columns.
By default the first column contains a timestamp for each row. The time
unit can be selected via the timestamp argument.

:param *labels: Any number of positional arguments, each corresponding to an entry in the log header.
:param timestamp: Select the timestamp unit that will be automatically added as the first column in every row. Timestamp values can be one of ``log.MILLISECONDS``, ``log.SECONDS``, ``log.MINUTES``, ``log.HOURS``, ``log.DAYS`` or ``None`` to disable the timestamp. The default value is ``log.SECONDS``."""
:param *labels: 任意の数の位置引数で。それぞれがログヘッダの見出しになります。
:param timestamp: すべての行の最初の列として自動的に追加されるタイムスタンプの単位を選択します。タイムスタンプの値は ``log.MILLISECONDS`` ``log.SECONDS````log.MINUTES````log.HOURS````log.DAYS`` またはタイムスタンプを無効にする ``None`` のうちのいずれかである必要があります。デフォルト値は ``log.SECONDS`` です。"""
...

@overload
Expand All @@ -46,7 +46,7 @@ to the log with the extra labels.
Labels previously specified and not present in a call to this function will
be skipped with an empty value in the log row.

:param data_dictionary: The data to log as a dictionary with a key for each header."""
:param data_dictionary: (data dictionary とはデータ辞書の意味です) 記録するデータを辞書で指定します。辞書の各キーが見出しを表します。"""
...

@overload
Expand Down Expand Up @@ -75,15 +75,15 @@ To add the log headers again the ``set_labels`` function should to be called aft
There are two erase modes; “full” completely removes the data from the physical storage,
and “fast” invalidates the data without removing it.

:param full: ``True`` selects a “full” erase and ``False`` selects the “fast” erase method."""
:param full: ``True`` を指定すると「完全」消去になり、``False`` を指定すると「高速」消去になります。"""
...

def set_mirroring(serial: bool):
"""Configure mirroring of the data logging activity to the serial output.
"""ログのデータ記録をシリアル出力にミラーリングするかを設定します。

Example: ``log.set_mirroring(True)``

Serial mirroring is disabled by default. When enabled, it will print to serial each row logged into the log file.

:param serial: ``True`` enables mirroring data to the serial output."""
:param serial: ``True`` を指定するとシリアル出力にデータをミラーリングします。"""
...
51 changes: 38 additions & 13 deletions lang/ja/typeshed/stdlib/microbit/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""端子、イメージ、サウンド、温度と音量。"""
from typing import Any, Callable, List, Optional, Tuple, overload
from typing import Any, Callable, List, Optional, Tuple, Union, overload
from _typeshed import ReadableBuffer
from . import accelerometer as accelerometer
from . import audio as audio
Expand All @@ -12,7 +12,7 @@ from . import spi as spi
from . import uart as uart

def run_every(callback: Optional[Callable[[], None]]=None, days: int=0, h: int=0, min: int=0, s: int=0, ms: int=0) -> Callable[[Callable[[], None]], Callable[[], None]]:
"""Schedule to run a function at the interval specified by the time arguments **V2 only**.
"""time 引数で指定した間隔で関数を実行するようスケジュールします。 **V2** のみで使えます。

Example: ``run_every(my_logging, min=5)``

Expand All @@ -36,12 +36,12 @@ So ``run_every(min=1, s=30)`` schedules the callback every minute and a half.
When an exception is thrown inside the callback function it deschedules the
function. To avoid this you can catch exceptions with ``try/except``.

:param callback: Function to call at the provided interval. Omit when using as a decorator.
:param days: Sets the day mark for the scheduling.
:param h: Sets the hour mark for the scheduling.
:param min: Sets the minute mark for the scheduling.
:param s: Sets the second mark for the scheduling.
:param ms: Sets the millisecond mark for the scheduling."""
:param callback: 指定した間隔で呼び出す関数。デコレータとして使う場合は省略してください。
:param days: スケジューリングのための日数を設定します。
:param h: スケジューリングのための時間を設定します。
:param min: スケジューリングのための分を設定します。
:param s: スケジューリングのためのミリ秒を設定します。
:param ms: スケジューリングのための秒を設定します。"""

def panic(n: int) -> None:
"""パニックモードに入ります。
Expand All @@ -55,14 +55,39 @@ Requires restart."""
def reset() -> None:
"""ボードを再起動します。"""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[int, int]) -> int:
"""Converts a value from a range to an integer range.

Example: ``volume = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))``

For example, to convert an accelerometer X value to a speaker volume.

If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.

temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))

:param value: A number to convert.
:param from_: A tuple to define the range to convert from.
:param to: A tuple to define the range to convert to.
:return: The ``value`` converted to the ``to`` range."""

@overload
def scale(value: float, from_: Tuple[float, float], to: Tuple[float, float]) -> float:
"""Converts a value from a range to another range.
"""Converts a value from a range to a floating point range.

Example: ``temp_fahrenheit = scale(30, from_=(0.0, 100.0), to=(32.0, 212.0))``

Example: ``temp_fahrenheit = scale(30, from_=(0, 100), to=(32, 212))``
For example, to convert temperature from a Celsius scale to Fahrenheit.

This can be useful to convert values between inputs and outputs, for example an accelerometer X value to a speaker volume.
If one of the numbers in the ``to`` parameter is a floating point
(i.e a decimal number like ``10.0``), this function will return a
floating point number.
If they are both integers (i.e ``10``), it will return an integer::

Negative scaling is also supported, for example ``scale(25, from_=(0, 100), to=(0, -200))`` will return ``-50``.
returns_int = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 255))

:param value: A number to convert.
:param from_: A tuple to define the range to convert from.
Expand Down Expand Up @@ -434,7 +459,7 @@ Given an image object it's possible to display it via the ``display`` API::
SNAKE: Image
"""「へび」イメージ。"""
SCISSORS: Image
"""Scissors image."""
"""「はさみ」イメージ。"""
ALL_CLOCKS: List[Image]
"""すべての CLOCK_ イメージを順番に並べたリスト。"""
ALL_ARROWS: List[Image]
Expand Down
6 changes: 3 additions & 3 deletions lang/ja/typeshed/stdlib/microbit/accelerometer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Example: ``x, y, z = accelerometer.get_values()``
...

def get_strength() -> int:
"""Get the acceleration measurement of all axes combined, as a positive integer. This is the Pythagorean sum of the X, Y and Z axes.
"""すべての軸を合成した加速度測定値を正の整数値で得ます。これは X軸、Y軸、Z軸のピタゴラス和になります。

Example: ``accelerometer.get_strength()``

Expand Down Expand Up @@ -96,8 +96,8 @@ gestures can be detected using a loop with a small :func:`microbit.sleep` delay.
...

def set_range(value: int) -> None:
"""Set the accelerometer sensitivity range, in g (standard gravity), to the closest values supported by the hardware, so it rounds to either ``2``, ``4``, or ``8`` g.
"""加速度センサーの感度範囲を g (標準重力)で設定します。設定値は、ハードウェアがサポートする最も近い値、すなわち ``2````4````8`` g のいずれかに丸められます。

Example: ``accelerometer.set_range(8)``

:param value: New range for the accelerometer, an integer in ``g``."""
:param value: 加速度センサーの新しい感度範囲。``g`` 単位の整数値で指定します。"""
Loading