Units API.

See the Weblate's Web API documentation for detailed description of the API.

GET /api/units/13184033/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "translation": "https://l10n.opensuse.org/api/translations/packages-i18n/perl-master/ja/?format=api",
    "source": [
        "This module provides bare bones 'try'/'catch'/'finally' statements that are designed to minimize common mistakes with eval blocks, and NOTHING else.\n\nThis is unlike TryCatch which provides a nice syntax and avoids adding another call stack layer, and supports calling 'return' from the 'try' block to return from the parent subroutine. These extra features come at a cost of a few dependencies, namely Devel::Declare and Scope::Upper which are occasionally problematic, and the additional catch filtering uses Moose type constraints which may not be desirable either.\n\nThe main focus of this module is to provide simple and reliable error handling for those having a hard time installing TryCatch, but who still want to write correct 'eval' blocks without 5 lines of boilerplate each time.\n\nIt's designed to work as correctly as possible in light of the various pathological edge cases (see BACKGROUND) and to be compatible with any style of error values (simple strings, references, objects, overloaded objects, etc).\n\nIf the 'try' block dies, it returns the value of the last statement executed in the 'catch' block, if there is one. Otherwise, it returns 'undef' in scalar context or the empty list in list context. The following examples all assign '\"bar\"' to '$x':\n\n  my $x = try { die \"foo\" } catch { \"bar\" };   my $x = try { die \"foo\" } || \"bar\";   my $x = (try { die \"foo\" }) // \"bar\";\n\n  my $x = eval { die \"foo\" } || \"bar\";\n\nYou can add 'finally' blocks, yielding the following:\n\n  my $x;   try { die 'foo' } finally { $x = 'bar' };   try { die 'foo' } catch { warn \"Got a die: $_\" } finally { $x = 'bar' };\n\n'finally' blocks are always executed making them suitable for cleanup code which cannot be handled using local. You can add as many 'finally' blocks to a given 'try' block as you like.\n\nNote that adding a 'finally' block without a preceding 'catch' block suppresses any errors. This behaviour is consistent with using a standalone 'eval', but it is not consistent with 'try'/'finally' patterns found in other programming languages, such as Java, Python, Javascript or C#. If you learned the 'try'/'finally' pattern from one of these languages, watch out for this."
    ],
    "previous_source": "This module provides bare bones 'try'/'catch'/'finally' statements that are designed to minimize common mistakes with eval blocks, and NOTHING else.\n\nThis is unlike TryCatch which provides a nice syntax and avoids adding another call stack layer, and supports calling 'return' from the 'try' block to return from the parent subroutine. These extra features come at a cost of a few dependencies, namely Devel::Declare and Scope::Upper which are occasionally problematic, and the additional catch filtering uses Moose type constraints which may not be desirable either.\n\nThe main focus of this module is to provide simple and reliable error handling for those having a hard time installing TryCatch, but who still want to write correct 'eval' blocks without 5 lines of boilerplate each time.\n\nIt's designed to work as correctly as possible in light of the various pathological edge cases (see BACKGROUND) and to be compatible with any style of error values (simple strings, references, objects, overloaded objects, etc).\n\nIf the 'try' block dies, it returns the value of the last statement executed in the 'catch' block, if there is one. Otherwise, it returns 'undef' in scalar context or the empty list in list context. The following examples all assign '\"bar\"' to '$x':\n\n  my $x = try { die \"foo\" } catch { \"bar\" };   my $x = try { die \"foo\" } || \"bar\";   my $x = (try { die \"foo\" }) // \"bar\";\n\n  my $x = eval { die \"foo\" } || \"bar\";\n\nYou can add 'finally' blocks, yielding the following:\n\n  my $x;   try { die 'foo' } finally { $x = 'bar' };   try { die 'foo' } catch { warn \"Got a die: $_\" } finally { $x = 'bar' };\n\n'finally' blocks are always executed making them suitable for cleanup code which cannot be handled using local. You can add as many 'finally' blocks to a given 'try' block as you like.\n\nNote that adding a 'finally' block without a preceding 'catch' block suppresses any errors. This behaviour is consistent with using a standalone 'eval', but it is not consistent with 'try'/'finally' patterns found in other programming languages, such as Java, Python, Javascript or C#. If you learnt the 'try'/'finally' pattern from one of these languages, watch out for this.",
    "target": [
        "このモジュールは、evalブロックやNOTHINGでよくある間違いを最小限にするために設計された、最小限の「try」/「catch」/「finally」ステートメントを提供します。\n\nこれは、優れた構文を提供し、別のコールスタック層を追加することを避け、'try'ブロックから'return'を呼び出して親サブルーチンから戻ることをサポートするTryCatchとは異なります。これらの追加機能は、Devel::DeclareとScope::Upperなど、いくつかの依存関係を犠牲にして提供されます。これらは問題を引き起こすことがあり、追加のキャッチフィルタリングはMooseタイプの制約を使用しており、これも望ましくない可能性があります。\n\nこのモジュールの主な焦点は、TryCatchのインストールに苦労しているが、それでも毎回5行の定型文なしで正しい'eval'ブロックを書きたいと思っている人たちに、簡単で信頼性の高いエラー処理を提供することです。\n\nこれは、様々な病的なエッジケース(BACKGROUNDを参照)に照らして可能な限り正確に動作し、あらゆる種類のエラー値(単純な文字列、参照、オブジェクト、オーバーロードされたオブジェクトなど)と互換性があるように設計されています。\n\n'try'ブロックが終了した場合、'catch'ブロック内で最後に実行された文の値を返します。それ以外の場合は、スカラーコンテキストでは'undef'を返し、リストコンテキストでは空のリストを返します。次の例では、すべて「bar」を「$x」に割り当てています。\n\n  my $x = try { die \"foo\" } catch { \"bar\" };   my $x = try { die \"foo\" } || \"bar\";   my $x = (try { die \"foo\" }) // \"bar\";\n\n  my $x = eval { die \"foo\" } || \"bar\";\n\nYou can add 'finally' blocks, yielding the following:\n\n  my $x;   try { die 'foo' } finally { $x = 'bar' };   try { die 'foo' } catch { warn \"Got a die: $_\" } finally { $x = 'bar' };\n\n'finally'ブロックは常に実行され、ローカルを使用して処理できないクリーンアップコードに適しています。. 「finally」ブロックは、任意の「try」ブロックに好きなだけ追加できます。\n\n「catch」ブロックを前に付けずに「finally」ブロックを追加すると、エラーが抑制されることに注意してください。この動作はスタンドアロンの'eval'を使用する場合と一貫しているが、Java、Python、Javascript、C#などの他のプログラミング言語で見られる'try'/'finally'パターンとは一貫していません。これらの言語のいずれかから「try」/「finally」パターンを学んだ場合は、この点に注意してください。"
    ],
    "id_hash": -5863904564896294167,
    "content_hash": -5863904564896294167,
    "location": "",
    "context": "",
    "note": "tumbleweed/perl-Try-Tiny/description",
    "flags": "",
    "labels": [],
    "state": 20,
    "fuzzy": false,
    "translated": true,
    "approved": false,
    "position": 2827,
    "has_suggestion": false,
    "has_comment": false,
    "has_failing_check": false,
    "num_words": 373,
    "source_unit": "https://l10n.opensuse.org/api/units/13182559/?format=api",
    "priority": 100,
    "id": 13184033,
    "web_url": "https://l10n.opensuse.org/translate/packages-i18n/perl-master/ja/?checksum=2e9f39ddd4909ae9",
    "url": "https://l10n.opensuse.org/api/units/13184033/?format=api",
    "explanation": "",
    "extra_flags": "",
    "pending": false,
    "timestamp": "2022-02-23T16:53:45.846310Z"
}