Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -242,14 +242,12 @@ |
243 | 243 | * greater or equal to 100. |
244 | 244 | */ |
245 | 245 | function smwfInitNamespaces() { |
246 | | - global $smwgNamespaceIndex, $wgExtraNamespaces, $wgNamespacesWithSubpages, $wgLanguageCode, $smwgContLang; |
| 246 | + global $smwgNamespaceIndex, $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespacesWithSubpages, $wgLanguageCode, $smwgContLang; |
247 | 247 | |
248 | 248 | if (!isset($smwgNamespaceIndex)) { |
249 | 249 | $smwgNamespaceIndex = 100; |
250 | 250 | } |
251 | 251 | |
252 | | - smwfInitContentLanguage($wgLanguageCode); |
253 | | - |
254 | 252 | define('SMW_NS_PROPERTY', $smwgNamespaceIndex+2); |
255 | 253 | define('SMW_NS_PROPERTY_TALK', $smwgNamespaceIndex+3); |
256 | 254 | define('SMW_NS_TYPE', $smwgNamespaceIndex+4); |
— | — | @@ -259,9 +257,13 @@ |
260 | 258 | define('SMW_NS_RELATION', $smwgNamespaceIndex); |
261 | 259 | define('SMW_NS_RELATION_TALK', $smwgNamespaceIndex+1); |
262 | 260 | |
| 261 | + smwfInitContentLanguage($wgLanguageCode); |
| 262 | + |
263 | 263 | // Register namespace identifiers |
264 | 264 | if (!is_array($wgExtraNamespaces)) { $wgExtraNamespaces=array(); } |
265 | | - $wgExtraNamespaces = $wgExtraNamespaces + $smwgContLang->getNamespaceArray(); |
| 265 | + $wgExtraNamespaces = $wgExtraNamespaces + $smwgContLang->getNamespaces(); |
| 266 | + $wgNamespaceAliases = $wgNamespaceAliases + $smwgContLang->getNamespaceAliases(); |
| 267 | + |
266 | 268 | |
267 | 269 | // Support subpages only for talk pages by default |
268 | 270 | $wgNamespacesWithSubpages = $wgNamespacesWithSubpages + array( |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Language.php |
— | — | @@ -14,13 +14,25 @@ |
15 | 15 | protected $smwSpecialProperties; |
16 | 16 | protected $m_DatatypeLabels; |
17 | 17 | protected $m_DatatypeAliases = array(); |
| 18 | + protected $m_Namespaces; |
| 19 | + protected $m_NamespaceAliases = array(); |
| 20 | + |
18 | 21 | |
19 | 22 | /** |
20 | 23 | * Function that returns an array of namespace identifiers. |
21 | 24 | */ |
22 | | - abstract function getNamespaceArray(); |
| 25 | + function getNamespaces() { |
| 26 | + return $this->m_Namespaces; |
| 27 | + } |
23 | 28 | |
24 | 29 | /** |
| 30 | + * Function that returns an array of namespace aliases, if any. |
| 31 | + */ |
| 32 | + function getNamespaceAliases() { |
| 33 | + return $this->m_NamespaceAliases; |
| 34 | + } |
| 35 | + |
| 36 | + /** |
25 | 37 | * Return all labels that are available as names for built-in datatypes. Those |
26 | 38 | * are the types that users can access via [[has type::...]] (more built-in |
27 | 39 | * types may exist for internal purposes but the user won't need to |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEn.php |
— | — | @@ -212,19 +212,15 @@ |
213 | 213 | SMW_SP_POSSIBLE_VALUE => 'Allows value' |
214 | 214 | ); |
215 | 215 | |
216 | | - /** |
217 | | - * Function that returns the namespace identifiers. |
218 | | - */ |
219 | | - public function getNamespaceArray() { |
220 | | - return array( |
221 | | - SMW_NS_RELATION => 'Relation', |
222 | | - SMW_NS_RELATION_TALK => 'Relation_talk', |
223 | | - SMW_NS_PROPERTY => 'Property', |
224 | | - SMW_NS_PROPERTY_TALK => 'Property_talk', |
225 | | - SMW_NS_TYPE => 'Type', |
226 | | - SMW_NS_TYPE_TALK => 'Type_talk' |
227 | | - ); |
228 | | - } |
| 216 | +protected $m_Namespaces = array( |
| 217 | + SMW_NS_RELATION => 'Relation', |
| 218 | + SMW_NS_RELATION_TALK => 'Relation_talk', |
| 219 | + SMW_NS_PROPERTY => 'Property', |
| 220 | + SMW_NS_PROPERTY_TALK => 'Property_talk', |
| 221 | + SMW_NS_TYPE => 'Type', |
| 222 | + SMW_NS_TYPE_TALK => 'Type_talk' |
| 223 | +); |
| 224 | + |
229 | 225 | } |
230 | 226 | |
231 | 227 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageRu.php |
— | — | @@ -240,17 +240,23 @@ |
241 | 241 | ); |
242 | 242 | |
243 | 243 | |
244 | | - /** |
245 | | - * Function that returns the namespace identifiers. |
246 | | - */ |
247 | | - public function getNamespaceArray() { |
248 | | - return array( |
249 | | - SMW_NS_RELATION => 'Отношение', |
250 | | - SMW_NS_RELATION_TALK => 'Отношение_дискуссия', |
251 | | - SMW_NS_PROPERTY => 'Атрибут', |
252 | | - SMW_NS_PROPERTY_TALK => 'Атрибут_дискуссия', |
253 | | - SMW_NS_TYPE => 'Тип', |
254 | | - SMW_NS_TYPE_TALK => 'Тип_дискуссия' |
255 | | - ); |
256 | | - } |
| 244 | +protected $m_Namespaces = array( |
| 245 | + SMW_NS_RELATION => 'Отношение', |
| 246 | + SMW_NS_RELATION_TALK => 'Отношение_дискуссия', |
| 247 | + SMW_NS_PROPERTY => 'Атрибут', |
| 248 | + SMW_NS_PROPERTY_TALK => 'Атрибут_дискуссия', |
| 249 | + SMW_NS_TYPE => 'Тип', |
| 250 | + SMW_NS_TYPE_TALK => 'Тип_дискуссия' |
| 251 | +); |
| 252 | + |
| 253 | +protected $m_NamespaceAliases = array( |
| 254 | + // support English aliases for namespaces |
| 255 | + 'Relation' => SMW_NS_RELATION, |
| 256 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 257 | + 'Property' => SMW_NS_PROPERTY, |
| 258 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 259 | + 'Type' => SMW_NS_TYPE, |
| 260 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 261 | +); |
| 262 | + |
257 | 263 | } |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEs.php |
— | — | @@ -231,19 +231,25 @@ |
232 | 232 | SMW_SP_POSSIBLE_VALUE => 'Permite el valor' |
233 | 233 | ); |
234 | 234 | |
235 | | - /** |
236 | | - * Function that returns the namespace identifiers. |
237 | | - */ |
238 | | - function getNamespaceArray() { |
239 | | - return array( |
240 | | - SMW_NS_RELATION => "Relación", |
241 | | - SMW_NS_RELATION_TALK => "Discusión_relación", |
242 | | - SMW_NS_PROPERTY => "Atributo", |
243 | | - SMW_NS_PROPERTY_TALK => "Discusión_atributo", |
244 | | - SMW_NS_TYPE => "Tipos_de_datos", |
245 | | - SMW_NS_TYPE_TALK => "Discusión_tipos_de_datos" |
246 | | - ); |
247 | | - } |
| 235 | +protected $m_Namespaces = array( |
| 236 | + SMW_NS_RELATION => "Relación", |
| 237 | + SMW_NS_RELATION_TALK => "Discusión_relación", |
| 238 | + SMW_NS_PROPERTY => "Atributo", |
| 239 | + SMW_NS_PROPERTY_TALK => "Discusión_atributo", |
| 240 | + SMW_NS_TYPE => "Tipos_de_datos", |
| 241 | + SMW_NS_TYPE_TALK => "Discusión_tipos_de_datos" |
| 242 | +); |
| 243 | + |
| 244 | +protected $m_NamespaceAliases = array( |
| 245 | + // support English aliases for namespaces |
| 246 | + 'Relation' => SMW_NS_RELATION, |
| 247 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 248 | + 'Property' => SMW_NS_PROPERTY, |
| 249 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 250 | + 'Type' => SMW_NS_TYPE, |
| 251 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 252 | +); |
| 253 | + |
248 | 254 | } |
249 | 255 | |
250 | 256 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageFr.php |
— | — | @@ -232,19 +232,25 @@ |
233 | 233 | SMW_SP_POSSIBLE_VALUE => 'Valeur possible' |
234 | 234 | ); |
235 | 235 | |
236 | | - /** |
237 | | - * Function that returns the namespace identifiers. |
238 | | - */ |
239 | | - public function getNamespaceArray() { |
240 | | - return array( |
241 | | - SMW_NS_RELATION => "Relation", |
242 | | - SMW_NS_RELATION_TALK => "Discussion_relation", |
243 | | - SMW_NS_PROPERTY => "Attribut", |
244 | | - SMW_NS_PROPERTY_TALK => "Discussion_attribut", |
245 | | - SMW_NS_TYPE => "Type", |
246 | | - SMW_NS_TYPE_TALK => "Discussion_type" |
247 | | - ); |
248 | | - } |
| 236 | +protected $m_Namespaces = array( |
| 237 | + SMW_NS_RELATION => "Relation", |
| 238 | + SMW_NS_RELATION_TALK => "Discussion_relation", |
| 239 | + SMW_NS_PROPERTY => "Attribut", |
| 240 | + SMW_NS_PROPERTY_TALK => "Discussion_attribut", |
| 241 | + SMW_NS_TYPE => "Type", |
| 242 | + SMW_NS_TYPE_TALK => "Discussion_type" |
| 243 | +); |
| 244 | + |
| 245 | +protected $m_NamespaceAliases = array( |
| 246 | + // support English aliases for namespaces |
| 247 | + //'Relation' => SMW_NS_RELATION, |
| 248 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 249 | + 'Property' => SMW_NS_PROPERTY, |
| 250 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 251 | + 'Type' => SMW_NS_TYPE, |
| 252 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 253 | +); |
| 254 | + |
249 | 255 | } |
250 | 256 | |
251 | 257 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageDe.php |
— | — | @@ -221,20 +221,25 @@ |
222 | 222 | SMW_SP_POSSIBLE_VALUE => 'Erlaubt Wert' |
223 | 223 | ); |
224 | 224 | |
225 | | - /** |
226 | | - * Function that returns the namespace identifiers. |
227 | | - */ |
228 | | - public function getNamespaceArray() { |
229 | | - return array( |
230 | | - SMW_NS_RELATION => "Relation", |
231 | | - SMW_NS_RELATION_TALK => "Relation_Diskussion", |
232 | | - SMW_NS_PROPERTY => "Attribut", |
233 | | - SMW_NS_PROPERTY_TALK => "Attribut_Diskussion", |
234 | | - SMW_NS_TYPE => "Datentyp", |
235 | | - SMW_NS_TYPE_TALK => "Datentyp_Diskussion" |
236 | | - ); |
237 | | - } |
| 225 | +protected $m_Namespaces = array( |
| 226 | + SMW_NS_RELATION => "Relation", |
| 227 | + SMW_NS_RELATION_TALK => "Relation_Diskussion", |
| 228 | + SMW_NS_PROPERTY => "Attribut", |
| 229 | + SMW_NS_PROPERTY_TALK => "Attribut_Diskussion", |
| 230 | + SMW_NS_TYPE => "Datentyp", |
| 231 | + SMW_NS_TYPE_TALK => "Datentyp_Diskussion" |
| 232 | +); |
238 | 233 | |
| 234 | +protected $m_NamespaceAliases = array( |
| 235 | + // support English aliases for namespaces |
| 236 | + //'Relation' => SMW_NS_RELATION, |
| 237 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 238 | + 'Property' => SMW_NS_PROPERTY, |
| 239 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 240 | + 'Type' => SMW_NS_TYPE, |
| 241 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 242 | +); |
| 243 | + |
239 | 244 | } |
240 | 245 | |
241 | 246 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageNl.php |
— | — | @@ -217,17 +217,23 @@ |
218 | 218 | SMW_SP_POSSIBLE_VALUE => 'Geldige waarde' |
219 | 219 | ); |
220 | 220 | |
221 | | - /** |
222 | | - * Function that returns the namespace identifiers. |
223 | | - */ |
224 | | - public function getNamespaceArray() { |
225 | | - return array( |
226 | | - SMW_NS_RELATION => 'Relatie', |
227 | | - SMW_NS_RELATION_TALK => 'Overleg_relatie', |
228 | | - SMW_NS_PROPERTY => 'Eigenschap', |
229 | | - SMW_NS_PROPERTY_TALK => 'Overleg_eigenschap', |
230 | | - SMW_NS_TYPE => 'Type', |
231 | | - SMW_NS_TYPE_TALK => 'Overleg_type' |
232 | | - ); |
233 | | - } |
| 221 | +protected $m_Namespaces = array( |
| 222 | + SMW_NS_RELATION => 'Relatie', |
| 223 | + SMW_NS_RELATION_TALK => 'Overleg_relatie', |
| 224 | + SMW_NS_PROPERTY => 'Eigenschap', |
| 225 | + SMW_NS_PROPERTY_TALK => 'Overleg_eigenschap', |
| 226 | + SMW_NS_TYPE => 'Type', |
| 227 | + SMW_NS_TYPE_TALK => 'Overleg_type' |
| 228 | +); |
| 229 | + |
| 230 | +protected $m_NamespaceAliases = array( |
| 231 | + // support English aliases for namespaces |
| 232 | + 'Relation' => SMW_NS_RELATION, |
| 233 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 234 | + 'Property' => SMW_NS_PROPERTY, |
| 235 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 236 | + 'Type' => SMW_NS_TYPE, |
| 237 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 238 | +); |
| 239 | + |
234 | 240 | } |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguagePl.php |
— | — | @@ -264,19 +264,25 @@ |
265 | 265 | ); |
266 | 266 | |
267 | 267 | |
268 | | - /** |
269 | | - * Function that returns the namespace identifiers. |
270 | | - */ |
271 | | - public function getNamespaceArray() { |
272 | | - return array( |
273 | | - SMW_NS_RELATION => 'Relacja', |
274 | | - SMW_NS_RELATION_TALK => 'Dyskusja_relacji', |
275 | | - SMW_NS_PROPERTY => 'Atrybut', |
276 | | - SMW_NS_PROPERTY_TALK => 'Dyskusja_atrybutu', |
277 | | - SMW_NS_TYPE => 'Typ', |
278 | | - SMW_NS_TYPE_TALK => 'Dyskusja_typu' |
279 | | - ); |
280 | | - } |
| 268 | +protected $m_Namespaces = array( |
| 269 | + SMW_NS_RELATION => 'Relacja', |
| 270 | + SMW_NS_RELATION_TALK => 'Dyskusja_relacji', |
| 271 | + SMW_NS_PROPERTY => 'Atrybut', |
| 272 | + SMW_NS_PROPERTY_TALK => 'Dyskusja_atrybutu', |
| 273 | + SMW_NS_TYPE => 'Typ', |
| 274 | + SMW_NS_TYPE_TALK => 'Dyskusja_typu' |
| 275 | +); |
| 276 | + |
| 277 | +protected $m_NamespaceAliases = array( |
| 278 | + // support English aliases for namespaces |
| 279 | + 'Relation' => SMW_NS_RELATION, |
| 280 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 281 | + 'Property' => SMW_NS_PROPERTY, |
| 282 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 283 | + 'Type' => SMW_NS_TYPE, |
| 284 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 285 | +); |
| 286 | + |
281 | 287 | } |
282 | 288 | |
283 | 289 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageHe.php |
— | — | @@ -244,17 +244,23 @@ |
245 | 245 | ); |
246 | 246 | |
247 | 247 | |
248 | | - /** |
249 | | - * Function that returns the namespace identifiers. |
250 | | - */ |
251 | | - public function getNamespaceArray() { |
252 | | - return array( |
253 | | - SMW_NS_RELATION => 'יחס', |
254 | | - SMW_NS_RELATION_TALK => 'שיחת_יחס', |
255 | | - SMW_NS_PROPERTY => 'תכונה', |
256 | | - SMW_NS_PROPERTY_TALK => 'שיחת_תכונה', |
257 | | - SMW_NS_TYPE => 'טיפוס', |
258 | | - SMW_NS_TYPE_TALK => 'שיחת_טיפוס' |
259 | | - ); |
260 | | - } |
| 248 | +protected $m_Namespaces = array( |
| 249 | + SMW_NS_RELATION => 'יחס', |
| 250 | + SMW_NS_RELATION_TALK => 'שיחת_יחס', |
| 251 | + SMW_NS_PROPERTY => 'תכונה', |
| 252 | + SMW_NS_PROPERTY_TALK => 'שיחת_תכונה', |
| 253 | + SMW_NS_TYPE => 'טיפוס', |
| 254 | + SMW_NS_TYPE_TALK => 'שיחת_טיפוס' |
| 255 | +); |
| 256 | + |
| 257 | +protected $m_NamespaceAliases = array( |
| 258 | + // support English aliases for namespaces |
| 259 | + 'Relation' => SMW_NS_RELATION, |
| 260 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 261 | + 'Property' => SMW_NS_PROPERTY, |
| 262 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 263 | + 'Type' => SMW_NS_TYPE, |
| 264 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 265 | +); |
| 266 | + |
261 | 267 | } |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageSk.php |
— | — | @@ -241,19 +241,25 @@ |
242 | 242 | ); |
243 | 243 | |
244 | 244 | |
245 | | - /** |
246 | | - * Function that returns the namespace identifiers. |
247 | | - */ |
248 | | - public function getNamespaceArray() { |
249 | | - return array( |
250 | | - SMW_NS_RELATION => 'Vzťah', |
251 | | - SMW_NS_RELATION_TALK => 'Diskusia o vzťahu', |
252 | | - SMW_NS_PROPERTY => 'Atribút', |
253 | | - SMW_NS_PROPERTY_TALK => 'Diskusia o atribúte', |
254 | | - SMW_NS_TYPE => 'Typ', |
255 | | - SMW_NS_TYPE_TALK => 'Diskusia o type' |
256 | | - ); |
257 | | - } |
| 245 | +protected $m_Namespaces = array( |
| 246 | + SMW_NS_RELATION => 'Vzťah', |
| 247 | + SMW_NS_RELATION_TALK => 'Diskusia o vzťahu', |
| 248 | + SMW_NS_PROPERTY => 'Atribút', |
| 249 | + SMW_NS_PROPERTY_TALK => 'Diskusia o atribúte', |
| 250 | + SMW_NS_TYPE => 'Typ', |
| 251 | + SMW_NS_TYPE_TALK => 'Diskusia o type' |
| 252 | +); |
| 253 | + |
| 254 | +protected $m_NamespaceAliases = array( |
| 255 | + // support English aliases for namespaces |
| 256 | + 'Relation' => SMW_NS_RELATION, |
| 257 | + 'Relation_talk' => SMW_NS_RELATION_TALK, |
| 258 | + 'Property' => SMW_NS_PROPERTY, |
| 259 | + 'Property_talk' => SMW_NS_PROPERTY_TALK, |
| 260 | + 'Type' => SMW_NS_TYPE, |
| 261 | + 'Type_talk' => SMW_NS_TYPE_TALK |
| 262 | +); |
| 263 | + |
258 | 264 | } |
259 | 265 | |
260 | 266 | |