Coverage for src/lexigram/admin/settings/panel/i18n_spec.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 14:56 +0800

1"""Internationalization configuration specification.""" 

2 

3from __future__ import annotations 

4 

5from lexigram.admin.settings.panel.models import I18nSettings 

6from lexigram.admin.settings.panel.nodes import PydanticConfigSpec 

7from lexigram.admin.settings.panel.registry import ConfigRegistry 

8 

9__all__ = ["I18nSpec", "register_spec"] 

10 

11 

12class I18nSpec(PydanticConfigSpec): 

13 """Internationalization configuration spec.""" 

14 

15 namespace = "admin.i18n" 

16 label = "Internationalization" 

17 icon = "globe" 

18 description = "Default locale and timezone for admin pages." 

19 model = I18nSettings 

20 required_permissions = frozenset({"admin.settings.edit"}) 

21 scope = "tenant" 

22 

23 

24def register_spec(registry: ConfigRegistry) -> None: 

25 """Register this spec with the config registry.""" 

26 registry.register_spec(I18nSpec)