Skip to content

Commit c3f2a61

Browse files
authored
Merge pull request #368 from ma10/fix-freee_a11y_gl-20250703
minor fix for freee_a11y_gl library
2 parents f51c0c1 + fb4a389 commit c3f2a61

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tools/lib/freee_a11y_gl/src/freee_a11y_gl/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def get_platform_name(cls, platform: str, lang: Optional[LanguageCode] = None) -
156156
"""Get localized platform name."""
157157
effective_lang = lang if lang is not None else settings.get("languages.default", "ja")
158158
try:
159-
return settings.config.platform.names[platform][effective_lang]
159+
return settings.config.platform.names[effective_lang][platform]
160160
except (KeyError, AttributeError):
161161
return platform
162162

tools/lib/freee_a11y_gl/src/freee_a11y_gl/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Any, Dict, Optional, List, Literal
66
import yaml
7-
from pydantic import BaseModel, Field, validator
7+
from pydantic import BaseModel, Field, field_validator
88

99
class LocaleConfig(BaseModel):
1010
"""Locale-specific configuration."""
@@ -28,7 +28,8 @@ class PathConfig(BaseModel):
2828
guidelines: str = Field(default="/categories/", description="Guidelines path (must start and end with /)")
2929
faq: str = Field(default="/faq/articles/", description="FAQ path (must start and end with /)")
3030

31-
@validator("guidelines", "faq")
31+
@field_validator("guidelines", "faq")
32+
@classmethod
3233
def validate_path(cls, v: str) -> str:
3334
"""Validate path string.
3435
@@ -163,7 +164,7 @@ def __init__(self):
163164
def load_defaults(self) -> None:
164165
"""デフォルト設定の読み込み"""
165166
# Pydanticモデルのデフォルト値を使用
166-
self._settings = GlobalConfig().dict()
167+
self._settings = GlobalConfig().model_dump()
167168

168169
def _get_config_search_paths(self) -> List[Path]:
169170
"""Get list of paths to search for config files.

0 commit comments

Comments
 (0)