| 133 | } |
| 134 | |
| 135 | function mergeMessages(base, override) { |
| 136 | const result = { ...base }; |
| 137 | for (const [key, value] of Object.entries(override)) { |
| 138 | const existing = result[key]; |
| 139 | if ( |
| 140 | existing && |
| 141 | typeof existing === "object" && |
| 142 | !Array.isArray(existing) && |
| 143 | value && |
| 144 | typeof value === "object" && |
| 145 | !Array.isArray(value) |
| 146 | ) { |
| 147 | result[key] = mergeMessages(existing, value); |
| 148 | } else { |
| 149 | result[key] = value; |
| 150 | } |
| 151 | } |
| 152 | return result; |
| 153 | } |
| 154 | |
| 155 | // i18next pluralization: _one/_other suffixes map to the base key in code |
| 156 | function baseKey(key) { |