File size: 230 Bytes
b4291bc
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from pathlib import Path

from backend.core.constants import LANGUAGE_MAP


def detect_language(path: Path) -> str:
    if path.name == ".env.example":
        return "env"
    return LANGUAGE_MAP.get(path.suffix.lower(), "text")