<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="en">
    <body>
      <trans-unit xml:space="preserve" approved="no" id="8bd7067f8a0d6183" weblate-flags="read-only, safe-html, strict-same">
        <source>= Contextual Conversions Previously in this section we've been assuming that there is a particular fitting JSON representation for a type. But this is not always the case. Often one needs to represent particular value with JSON of certain format in one situation and with another format in a different situation. This can be achieved with Boost.JSON by providing an extra argument---context.</source>
        <target state="translated">= Contextual Conversions Previously in this section we've been assuming that there is a particular fitting JSON representation for a type. But this is not always the case. Often one needs to represent particular value with JSON of certain format in one situation and with another format in a different situation. This can be achieved with Boost.JSON by providing an extra argument---context.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">10</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="99e88278dc51d77a" weblate-flags="read-only, safe-html, strict-same">
        <source>Let's implement conversion from `user_ns::ip_address` to a JSON string:</source>
        <target state="translated">Let's implement conversion from `user_ns::ip_address` to a JSON string:</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">17</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f1cdeb05ce82c770" weblate-flags="read-only, safe-html, strict-same">
        <source>These `tag_invoke` overloads take an extra `as_string` parameter, which disambiguates this specific representation of `ip_address` from all other potential representations. In order to take advantage of them one needs to pass an `as_string` object to &lt;&lt;ref_value_from&gt;&gt; or &lt;&lt;ref_value_to&gt;&gt; as the last argument:</source>
        <target state="translated">These `tag_invoke` overloads take an extra `as_string` parameter, which disambiguates this specific representation of `ip_address` from all other potential representations. In order to take advantage of them one needs to pass an `as_string` object to &lt;&lt;ref_value_from&gt;&gt; or &lt;&lt;ref_value_to&gt;&gt; as the last argument:</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">25</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="3240c4bd314e5aff" weblate-flags="read-only, safe-html, strict-same">
        <source>Note, that if there is no dedicated `tag_invoke` overload for a given type and a given context, the implementation falls back to overloads without context. Thus it is easy to combine contextual conversions with conversions provided by the library:</source>
        <target state="translated">Note, that if there is no dedicated `tag_invoke` overload for a given type and a given context, the implementation falls back to overloads without context. Thus it is easy to combine contextual conversions with conversions provided by the library:</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">36</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f04dd0b2443550d8" weblate-flags="read-only, safe-html, strict-same">
        <source>Conversions for Third-Party Types</source>
        <target state="translated">Conversions for Third-Party Types</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">46</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="7d3411990ee59706" weblate-flags="read-only, safe-html, strict-same">
        <source>Normally, you wouldn't be able to provide conversions for types from third-party libraries and standard types, because it would require yout to put `tag_invoke` overloads into namespaces you do not control. But with contexts you can put the overloads into your namespaces. This is because the context will add its associated namespaces into the list of namespaces where `tag_invoke` overloads are searched.</source>
        <target state="translated">Normally, you wouldn't be able to provide conversions for types from third-party libraries and standard types, because it would require yout to put `tag_invoke` overloads into namespaces you do not control. But with contexts you can put the overloads into your namespaces. This is because the context will add its associated namespaces into the list of namespaces where `tag_invoke` overloads are searched.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">47</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5e8043090d6f2360" weblate-flags="read-only, safe-html, strict-same">
        <source>As an example, let's implement conversion for https://en.cppreference.com/w/cpp/chrono/system_clock[``std::chrono::system_clock::time_point``s] using https://en.wikipedia.org/wiki/ISO_8601[ISO 8601] format.</source>
        <target state="translated">As an example, let's implement conversion for https://en.cppreference.com/w/cpp/chrono/system_clock[``std::chrono::system_clock::time_point``s] using https://en.wikipedia.org/wiki/ISO_8601[ISO 8601] format.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">54</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="82b278ee51a16d0b" weblate-flags="read-only, safe-html, strict-same">
        <source>Reverse conversion is left out for brevity.</source>
        <target state="translated">Reverse conversion is left out for brevity.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">63</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="499e956ee68ee16d" weblate-flags="read-only, safe-html, strict-same">
        <source>The new context is used in a similar fashion to `as_string` previously in this section.</source>
        <target state="translated">The new context is used in a similar fashion to `as_string` previously in this section.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">65</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="9b14e227054625ce" weblate-flags="read-only, safe-html, strict-same">
        <source>One particular use case that is enabled by contexts is adaptor libraries that define JSON conversion logic for types from a different library.</source>
        <target state="translated">One particular use case that is enabled by contexts is adaptor libraries that define JSON conversion logic for types from a different library.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">73</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="de3ac167b26a7441" weblate-flags="read-only, safe-html, strict-same">
        <source>Passing Data to Conversion Functions</source>
        <target state="translated">Passing Data to Conversion Functions</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">76</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="de2438aa32eba486" weblate-flags="read-only, safe-html, strict-same">
        <source>Contexts we used so far were empty classes. But contexts may have data members and member functions just as any class. Implementers of conversion functions can take advantage of that to have conversions configurable at runtime or pass special objects to conversions (e.g. allocators).</source>
        <target state="translated">Contexts we used so far were empty classes. But contexts may have data members and member functions just as any class. Implementers of conversion functions can take advantage of that to have conversions configurable at runtime or pass special objects to conversions (e.g. allocators).</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">77</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f3d92f338d7709d9" weblate-flags="read-only, safe-html, strict-same">
        <source>Let's rewrite conversion for ``system_clock::time_point``s to allow any format supported by `std::strftime`.</source>
        <target state="translated">Let's rewrite conversion for ``system_clock::time_point``s to allow any format supported by `std::strftime`.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">82</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b6c3f3d164ef1a87" weblate-flags="read-only, safe-html, strict-same">
        <source>This `tag_invoke` overload lets us change date conversion format at runtime. Also note, that there is no ambiguity between `as_iso_8601` overload and `date_format` overload. You can use both in your program:</source>
        <target state="translated">This `tag_invoke` overload lets us change date conversion format at runtime. Also note, that there is no ambiguity between `as_iso_8601` overload and `date_format` overload. You can use both in your program:</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">90</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a24527620337913c" weblate-flags="read-only, safe-html, strict-same">
        <source>Combining Contexts</source>
        <target state="translated">Combining Contexts</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">99</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="201eb2588efd31ad" weblate-flags="read-only, safe-html, strict-same">
        <source>Often it is needed to use several conversion contexts together. For example, consider a log of remote users identified by IP addresses accessing a system. We can represent it as `std::vector&lt;std::pair&lt;std::chrono::system_clock::time_point, ip_address&gt;&gt;`. We want to serialize both ``ip_address``es and ``time_point``s as strings, but for this we need both `as_string` and `as_iso_8601` contexts. To combine several contexts just use {std_tuple}. Conversion functions will select the first element of the tuple for which a `tag_invoke` overload exists and will call that overload. As usual, `tag_invoke` overloads that don't use contexts and library-provided generic conversions are also supported. Thus, here's our example:</source>
        <target state="translated">Often it is needed to use several conversion contexts together. For example, consider a log of remote users identified by IP addresses accessing a system. We can represent it as `std::vector&lt;std::pair&lt;std::chrono::system_clock::time_point, ip_address&gt;&gt;`. We want to serialize both ``ip_address``es and ``time_point``s as strings, but for this we need both `as_string` and `as_iso_8601` contexts. To combine several contexts just use {std_tuple}. Conversion functions will select the first element of the tuple for which a `tag_invoke` overload exists and will call that overload. As usual, `tag_invoke` overloads that don't use contexts and library-provided generic conversions are also supported. Thus, here's our example:</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">100</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="180447a793383872" weblate-flags="read-only, safe-html, strict-same">
        <source>In this snippet `time_point` is converted using `tag_invoke` overload that takes `as_iso_8601`, `ip_address` is converted using `tag_invoke` overload that takes `as_string`, and {std_vector} is converted using a generic conversion provided by the library.</source>
        <target state="translated">In this snippet `time_point` is converted using `tag_invoke` overload that takes `as_iso_8601`, `ip_address` is converted using `tag_invoke` overload that takes `as_string`, and {std_vector} is converted using a generic conversion provided by the library.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">117</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="bd32d84568257424" weblate-flags="read-only, safe-html, strict-same">
        <source>Contexts and Composite Types</source>
        <target state="translated">Contexts and Composite Types</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">122</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d5fcb044488d278c" weblate-flags="read-only, safe-html, strict-same">
        <source>As was shown previously, generic conversions provided by the library forward contexts to conversions of nested objects. And in the case when you want to provide your own conversion function for a composite type enabled by a particular context, you usually also need to do that.</source>
        <target state="translated">As was shown previously, generic conversions provided by the library forward contexts to conversions of nested objects. And in the case when you want to provide your own conversion function for a composite type enabled by a particular context, you usually also need to do that.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">123</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b067041d89c914c5" weblate-flags="read-only, safe-html, strict-same">
        <source>Consider this example. As was discussed in a previous section, &lt;&lt;ref_is_map_like&gt;&gt; requires that your key type satisfies &lt;&lt;ref_is_string_like&gt;&gt;. Now, let's say your keys are not string-like, but they do convert to &lt;&lt;ref_string&gt;&gt;. You can make such maps to also convert to objects using a context. But if you want to also use another context for values, you need a way to pass the full combined context to map elements. So, you want the following test to succeed.</source>
        <target state="translated">Consider this example. As was discussed in a previous section, &lt;&lt;ref_is_map_like&gt;&gt; requires that your key type satisfies &lt;&lt;ref_is_string_like&gt;&gt;. Now, let's say your keys are not string-like, but they do convert to &lt;&lt;ref_string&gt;&gt;. You can make such maps to also convert to objects using a context. But if you want to also use another context for values, you need a way to pass the full combined context to map elements. So, you want the following test to succeed.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">128</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ff0b372acf9141d4" weblate-flags="read-only, safe-html, strict-same">
        <source>For this you will have to use a different overload of `tag_invoke`. This time it has to be a function template, and it should have two parameters for contexts. The first parameter is the specific context that disambiguates that particular overload. The second parameter is the full context passed to &lt;&lt;ref_value_to&gt;&gt; or &lt;&lt;ref_value_from&gt;&gt;.</source>
        <target state="translated">For this you will have to use a different overload of `tag_invoke`. This time it has to be a function template, and it should have two parameters for contexts. The first parameter is the specific context that disambiguates that particular overload. The second parameter is the full context passed to &lt;&lt;ref_value_to&gt;&gt; or &lt;&lt;ref_value_from&gt;&gt;.</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile"></context>
          <context context-type="linenumber">141</context>
        </context-group>
      </trans-unit>
    </body>
  </file>
</xliff>
