Nothing
Code
export(loc1, 1L)
Condition
Error:
! 'id' must be a non-NA and non-empty character of length 1.
Code
export(txt1, 1L)
Condition
Error:
! 'id' must be a non-NA and non-empty character of length 1.
Code
export(txt1, set_translations = 1L)
Condition
Error:
! 'set_translations' must be a non-NA logical of length 1 ('TRUE' or 'FALSE').
Code
cat(serialize(loc1, id = "test-id"))
Output
!<Location>
Identifier: test-id
Path: a
Ranges: Ln 1, Col 2 @ Ln 3, Col 4
Code
cat(serialize(txt1, id = "test-id"))
Output
!<Text>
Identifier: test-id
Algorithm: sha1
Hash: 256e0d707386d0fcd9abf10ad994000bdaa25812
Source Language: en
Source Text: Hello, world!
Translations: ~
Locations:
- !<Location>
Identifier: test-id:l1
Path: a
Ranges: Ln 1, Col 2 @ Ln 3, Col 4
Code
cat(serialize(tr))
Output
!<Translator>
Identifier: test-translator
Algorithm: sha1
Languages:
el: Ελληνικά
en: English
es: Español
fr: Français
Texts:
- !<Text>
Identifier: 256e0d7
Algorithm: sha1
Hash: 256e0d707386d0fcd9abf10ad994000bdaa25812
Source Language: en
Source Text: Hello, world!
Translations: ~
Locations:
- !<Location>
Identifier: 256e0d7:l1
Path: a
Ranges: Ln 1, Col 2 @ Ln 3, Col 4
- !<Text>
Identifier: 2ac373a
Algorithm: sha1
Hash: 2ac373aa699a6712cdaddbead28031d537de29bc
Source Language: en
Source Text: Farewell, world!
Translations: ~
Locations:
- !<Location>
Identifier: 2ac373a:l1
Path: b
Ranges: Ln 5, Col 6 @ Ln 7, Col 8
Code
cat(serialize(tr, set_translations = TRUE))
Output
!<Translator>
Identifier: test-translator
Algorithm: sha1
Languages:
en: English
fr: Français
Texts:
- !<Text>
Identifier: 818e96e
Algorithm: sha1
Hash: 818e96e5345d91681d5c34f26d4fd3f1846beb6a
Source Language: en
Source Text: |-
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
Translations:
fr: |-
Le Lorem Ipsum est simplement du faux texte employé dans la composition
et la mise en page avant impression. Le Lorem Ipsum est le faux texte
standard de l'imprimerie depuis les années 1500, quand un imprimeur
anonyme assembla ensemble des morceaux de texte pour réaliser un livre
spécimen de polices de texte.
Locations: []
Code
export_translations(tr, 1L)
Condition
Error:
! 'lang' must be a non-NA and non-empty character of length 1.
Code
export_translations(tr, "missing-lang")
Condition
Error:
! 'lang' must have a corresponding native language registered in 'tr'.
Code
export_translations(1L, "fr")
Condition
Error:
! 'tr' must be a 'Translator' object.
Code
export_translations(tr, "fr")
Condition
Error:
! all 'Text' objects of 'tr' must have the same 'source_lang'.
Code
cat(serialize_translations(tr, "el"), "\n")
Output
:: Identifier
test-translator:translations:el
:: Language Code
el
:: Language
Ελληνικά
:: Source Language
English
:: Translations: 256e0d7: Source Text
Hello, world!
:: Translations: 256e0d7: Translation
# Insert a translation here.
:: Translations: 2ac373a: Source Text
Farewell, world!
:: Translations: 2ac373a: Translation
# Insert a translation here.
Code
cat(serialize_translations(tr, "fr"), "\n")
Output
:: Identifier
test-translator:translations:fr
:: Language Code
fr
:: Language
Français
:: Source Language
English
:: Translations: 256e0d7: Source Text
Hello, world!
:: Translations: 256e0d7: Translation
Bonjour, monde!
:: Translations: 2ac373a: Source Text
Farewell, world!
:: Translations: 2ac373a: Translation
Au revoir, monde!
Code
cat(serialize_translations(tr, "fr"), "\n")
Output
:: Identifier
test-translator:translations:fr
:: Language Code
fr
:: Language
Français
:: Source Language
English
:: Translations: 818e96e: Source Text
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
specimen book.
:: Translations: 818e96e: Translation
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la
mise en page avant impression. Le Lorem Ipsum est le faux texte standard de
l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla
ensemble des morceaux de texte pour réaliser un livre spécimen de polices de
texte.
Code
format_errors(1L)
Condition
Error:
! 'errors' must be a non-empty character vector of non-NA values.
Code
format_errors("", throw_error = 1L)
Condition
Error:
! 'throw_error' must be a non-NA logical of length 1 ('TRUE' or 'FALSE').
Code
format_errors(errors, "test-id")
Condition
Error:
!
- 'Hash' must be a null, or a non-empty character string.
- 'Hash' is defined but not 'Source Text', and/or 'Source Lang'.
Code
assert(invalid)
Condition
Error:
!
- 'Path' must be a non-empty character string.
- 'Ranges' must be a single `Ln <int>, Col <int> @ Ln <int>, Col <int>` character string, or a sequence of such values.
Code
assert(out)
Condition
Error:
! 'Path' must be a non-empty character string.
Code
assert(out)
Condition
Error:
! 'Ranges' must be a single `Ln <int>, Col <int> @ Ln <int>, Col <int>` character string, or a sequence of such values.
Code
assert(invalid)
Condition
Error:
!
- 'Algorithm' must be equal to 'sha1', or 'utf8'.
- 'Hash' must be a null, or a non-empty character string.
- 'Source Language' must be a null, or a non-empty character string.
- 'Source Text' must be a null, or a non-empty character string.
- 'Translations' must be a null, or a mapping of non-empty character strings.
- 'Locations' must be a sequence of 'Location' objects.
Code
assert(out)
Condition
Error:
! 'Algorithm' must be equal to 'sha1', or 'utf8'.
Code
assert(out1)
Condition
Error:
! 'Hash' must be a null, or a non-empty character string.
Code
assert(out3)
Condition
Error:
! 'Hash' is defined but not 'Source Text', and/or 'Source Lang'.
Code
assert(out1)
Condition
Error:
!
- 'Hash' is defined but not 'Source Text', and/or 'Source Lang'.
- 'Source Language' must be a null, or a non-empty character string.
- 'Source Language' is defined but not 'Source Text', or vice-versa.
Code
assert(out1)
Condition
Error:
!
- 'Hash' is defined but not 'Source Text', and/or 'Source Lang'.
- 'Source Text' must be a null, or a non-empty character string.
- 'Source Language' is defined but not 'Source Text', or vice-versa.
Code
assert(out2)
Condition
Error:
! 'Source Text' must be a null, or a non-empty character string.
Code
assert(out1)
Condition
Error:
! 'Translations' must be a null, or a mapping of non-empty character strings.
Code
assert(out1)
Condition
Error:
! 'Locations' must be a sequence of 'Location' objects.
Code
assert(out3)
Condition
Error:
!
- ['test-id'] 'Path' must be a non-empty character string.
- ['test-id'] 'Ranges' must be a single `Ln <int>, Col <int> @ Ln <int>, Col <int>` character string, or a sequence of such values.
Code
assert(invalid)
Condition
Error:
!
- 'Identifier' must be a non-empty character string.
- 'Algorithm' must be equal to 'sha1', or 'utf8'.
- 'Languages' must a mapping of non-empty character strings.
- 'Texts' must a sequence of 'Text' objects.
Code
assert(out)
Condition
Error:
! 'Identifier' must be a non-empty character string.
Code
assert(out)
Condition
Error:
! 'Algorithm' must be equal to 'sha1', or 'utf8'.
Code
assert(out1)
Condition
Error:
! 'Languages' must a mapping of non-empty character strings.
Code
assert(out1)
Condition
Error:
! 'Texts' must a sequence of 'Text' objects.
Code
assert(out3)
Condition
Error:
!
- ['test-id'] 'Hash' must be a null, or a non-empty character string.
- ['test-id'] 'Algorithm' must be equal to 'sha1', or 'utf8'.
Code
assert(invalid)
Condition
Error:
!
- 'Identifier' must be a non-empty character string.
- 'Language Code' must be a non-empty character string.
- 'Language' must be a non-empty character string.
- 'Source Language' must be a non-empty character string.
- 'Translations' must be a sequence of 'Source Text', and 'Translation' sections.
Code
assert(out)
Condition
Error:
! 'Identifier' must be a non-empty character string.
Code
assert(out)
Condition
Error:
! 'Language Code' must be a non-empty character string.
Code
assert(out)
Condition
Error:
! 'Language' must be a non-empty character string.
Code
assert(out)
Condition
Error:
! 'Source Language' must be a non-empty character string.
Code
assert(out1)
Condition
Error:
!
- 'Translations' must be a sequence of 'Source Text', and 'Translation' sections.
- 'Translation' sections must be character strings. They can also be empty, but not missing.
Code
assert(out2)
Condition
Error:
! 'Translations' must be a sequence of 'Source Text', and 'Translation' sections.
Code
assert(out3)
Condition
Error:
! 'Source Text' sections must be character strings. They can also be empty, or missing.
Code
import(1L)
Condition
Error:
! deserialized object is not supported by transltr. It is likely missing a '!<type>' tag, or has an invalid one.
Code
import(etxt1)
Condition
Warning:
['test-id'] 'Hash' is not equal to computed hash ('256e0d707386d0fcd9abf10ad994000bdaa25812'). The latter will be used.
Output
<Text>
Hash: 256e0d707386d0fcd9abf10ad994000bdaa25812
Source Lang: en
Algorithm: sha1
Translations:
en: Hello, world!
es: ¡Hola Mundo!
fr: Bonjour, monde!
Locations:
a:
<Location>
Path: a
Ranges: Ln 1, Col 2 @ Ln 3, Col 4
Code
deserialize(1L)
Condition
Error:
! 'string' must be a non-NA and non-empty character of length 1.
Code
deserialize("a: 1\nb 2\n")
Condition
Error:
! while unserializing object: scanner error: while scanning a simple key at line 2, column 1 could not find expected ':' at line 3, column 1.
Code
import(export_translations(tr, "fr"), 1L)
Condition
Error:
! 'tr' must be a 'Translator' object.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.