(self, fallback: str = "en-US")
| 124 | return self._normalize_accept_language_header(fallback, fallback=fallback) |
| 125 | |
| 126 | def _get_primary_locale_code(self, fallback: str = "en-US") -> str: |
| 127 | fingerprint = self.get_request_fingerprint() |
| 128 | if isinstance(fingerprint, dict): |
| 129 | language = str(fingerprint.get("language") or "").strip() |
| 130 | if language: |
| 131 | return language |
| 132 | accept_language = str(fingerprint.get("accept_language") or "").strip() |
| 133 | if accept_language: |
| 134 | primary = accept_language.split(",", 1)[0].strip() |
| 135 | if primary: |
| 136 | return primary |
| 137 | return fallback |
| 138 | |
| 139 | def _infer_sec_ch_ua_from_user_agent(self, user_agent: Optional[str]) -> str: |
| 140 | ua = str(user_agent or "").strip() |
nothing calls this directly
no test coverage detected