Permalink
Browse files

fix(docs): clarify the description of the checking logic

  • Loading branch information...
1 parent ed22da5 commit 98f916ffda9c4236540208ef64e33387b9ad18f3 @philbooth philbooth committed Sep 16, 2015
Showing with 13 additions and 14 deletions.
  1. +13 −14 README.md
View
@@ -61,24 +61,23 @@ The translated strings are checked, one by one, for:
* Unclosed elements (e.g., `<span>This span is not closed`)
* Elements closed in the wrong order.
* (e.g., `<a><span>closed out of order</a></span>`)
-1. Unexpected tags
+1. Unexpected tags. Tag names that are not used in the source `.pot` files may not be present in the translated `.po` files. For instance:
* If the source `.pot` files contain only `a` and `span` tags, the translated files:
1. Can contain 0 or more `a` and `span` tags.
1. All other tags cause an error.
-1. Unexpected tag attributes
- * If the source `.pot` files contain `<a href="/signin" target="_blank">`,
- `<button id="logout">`, and `<div>...`, the translated files:
- 1. Can have 0 or more `a` elements, which can have 0, 1 or both `href` and `target` attributes.
- 1. Can have 0 or more `button` elements, which can 0 or 1 `id` attribute.
+1. Unexpected attributes. Attributes that are not used on a type of element in the source `.pot` files may not be present on instances of that element type in the translated `.po` files. For instance:
+ * If the source `.pot` files contain `<a href="..." target="...">`,
+ `<button id="...">` and `<button class="...">`, the translated files:
+ 1. Can have either, both or neither of the `href` and `target` attributes on each `a` element.
+ 1. Can have either, both or neither of the `id` and `class` attributes on each `button` element.
1. All other attributes will cause an error.
-1. Unexpected tag attribute values
+1. Unexpected attribute values. Attribute values that are not used on a type of element in the source `.pot` files may not be present on instances of that element type in the translated `.po` files. For instance:
* If the source `.pot` files contain `<a href="/signin" target="_blank">`
- and `<button id="logout">`, and `<div>...`, the translated files:
- 1. Can have 0 or more `a` tags, which can have 0, 1 or both `href="/signin""` or
- `target="_blank"` attributes.
- 1. Can have 0 or more `button` elements, which can have 0 or 1 `id="logout"` attribute.
- 1. Can have 0 or more `div` elements, which can have no attributes.
- 1. All other attributes or attribute values cause an error.
+ and `<button id="logout">`, the translated files:
+ 1. Can only have the value `/signin` for `href` attributes.
+ 1. Can only have the value `_blank` for `target` attributes.
+ 1. Can only have the value `logout` for `id` attributes.
+ 1. All other attribute values cause an error.
The target translation checks are very coarse.
@@ -89,7 +88,7 @@ If the source `.pot` file contains two `a` elements, one
with `id="first-anchor"` and another with `id="second-anchor"`, _any_ translated
string could contain an `a` element with either `id`.
-All translated strings are assumed to be independent items, anduare checked
+All translated strings are assumed to be independent items, and are checked
individually. Quotes that surround attribute values are not checked, as long
as the tag correctly closes and the attribute value matches an expected value,
the value is accepted.

0 comments on commit 98f916f

Please sign in to comment.