Closed JensAyton closed 10 years ago
On further consideration, this is wrong; it will result in es-ES strings being used when pluralization is used. The correct approach is to look up the files up front so that you only get the es_MX strings. (NSBundle will fall back to es and English if no es_MX exists.)
Prior to this change, if you passed a custom table name and used a language where a fallback language was used to determine the pluralization rule, the tableName variable would be passed to
[self pathForResource:...]
multiple times. On the second time, passing an absolute string would produce a nil result.This would happen, for example, for Mexican Spanish, where the lang list is ("es_MX", "es-MX", "es", "English"), and "es" determines the pluralization rule.