Does 'open-closed principle' also includes files and data of the app? According to https://softwareengineering.stackexchange.com/a/296955/248528, it says files and data are't included, but it doesn't mentions if they should be included.
Suppose I have 2 ways to define the locale string of my app:
Method 1 : all locale strings in a single file:
locale.json
{
'title':{
'en':'Welcome',
'es':'bienvenida'
},
'hello_message':{
'en':'Welcome to use the app',
'es':'Bienvenido a usar la aplicación'
}
}
pseudo code to load locale : load locale.json directly
how to add a new locale: edit locale.json, add a new key at each string
Method 2 : one json for each locale
locale_en.json
{
'title':'Welcome',
'hello_message':'Welcome to use the app'
}
locale_es.json
{
'title':'bienvenida',
'hello_message':'Bienvenido a usar la aplicación',
}
pseudo code to load locale : search and load all locale_xx.json files in specific app data folder
how to add a new locale : add a new locale_xx.json file in specific app data folder
My question is, suppose I may need to add a new locale in the future, and the code to handle keeps unchanged, is Method 2 preferred because it follows 'open-closed principle?