5015 | | * The '%l' must be at the first characters can then contain the rest of the |
5016 | | * content. The list items will have ', ', ', and', and ' and ' added depending |
| 5015 | * The '%l', '%l$a' or '%l$o' must be at the first characters can then contain |
| 5016 | * the rest of the content. |
| 5017 | * |
| 5018 | * For '%l' and '%l$a' the list items will have ', ', ', and', and ' and 'added |
| 5019 | * depending on the amount of list items in the $args parameter. |
| 5020 | * |
| 5021 | * For '%l$o' the list items will have ', ', ', or', and ' or ' added depending |
| 5042 | |
| 5043 | // Localized delimiters for 'or' type. |
| 5044 | $l_or = array( |
| 5045 | /* translators: Used to join items in a list with more than 2 items. */ |
| 5046 | 'between' => sprintf( __( '%1$s, %2$s' ), '', '' ), |
| 5047 | /* translators: Used to join last two items in a list with more than 2 times. */ |
| 5048 | 'between_last_two' => sprintf( __( '%1$s, or %2$s' ), '', '' ), |
| 5049 | /* translators: Used to join items in a list with only 2 items. */ |
| 5050 | 'between_only_two' => sprintf( __( '%1$s or %2$s' ), '', '' ), |
| 5051 | ); |
| 5052 | |
| 5053 | // Localized delimiters for 'and' type. |
| 5054 | $l_and = array( |
| 5055 | /* translators: Used to join items in a list with more than 2 items. */ |
| 5056 | 'between' => sprintf( __( '%1$s, %2$s' ), '', '' ), |
| 5057 | /* translators: Used to join last two items in a list with more than 2 times. */ |
| 5058 | 'between_last_two' => sprintf( __( '%1$s, and %2$s' ), '', '' ), |
| 5059 | /* translators: Used to join items in a list with only 2 items. */ |
| 5060 | 'between_only_two' => sprintf( __( '%1$s and %2$s' ), '', '' ), |
| 5061 | ); |
| 5062 | |
| 5063 | // Set the delimiters type. Defaults to 'and' type for backward compatibility. |
| 5064 | switch ( substr( $pattern, 0, 4 ) ) { |
| 5065 | case '%l$o': |
| 5066 | $delimiters = $l_or; |
| 5067 | $length = 4; |
| 5068 | break; |
| 5069 | case '%l$a': |
| 5070 | $delimiters = $l_and; |
| 5071 | $length = 4; |
| 5072 | break; |
| 5073 | default: |
| 5074 | $delimiters = $l_and; |
| 5075 | $length = 2; |
| 5076 | break; |
| 5077 | } |
5049 | | array( |
5050 | | /* translators: Used to join items in a list with more than 2 items. */ |
5051 | | 'between' => sprintf( __( '%1$s, %2$s' ), '', '' ), |
5052 | | /* translators: Used to join last two items in a list with more than 2 times. */ |
5053 | | 'between_last_two' => sprintf( __( '%1$s, and %2$s' ), '', '' ), |
5054 | | /* translators: Used to join items in a list with only 2 items. */ |
5055 | | 'between_only_two' => sprintf( __( '%1$s and %2$s' ), '', '' ), |
5056 | | ) |
| 5093 | $delimiters |