Skip to content

Conversation

fl1pcoin
Copy link
Collaborator

Пока не стабильно переводятся названия секций README + В разработке добавление переведенных README на страницу github.

Примеры для https://github.com/Roman223/GAN_MFS
README_de.md
README_ru.md
README_zh.md

@fl1pcoin fl1pcoin self-assigned this Sep 28, 2025
@fl1pcoin fl1pcoin linked an issue Sep 28, 2025 that may be closed by this pull request
@fl1pcoin fl1pcoin requested a review from nicl-nno September 29, 2025 16:15
Comment on lines 24 to 42
async def translate_readme_request_async(
self, readme_content: str, target_language: str, semaphore: asyncio.Semaphore
) -> dict:
"""Asynchronous request to translate README content via LLM."""
prompt = PromptBuilder(self.config_loader).get_prompt_translate_readme(readme_content, target_language)
async with semaphore:
response = await self.model_handler.async_request(prompt)
response = process_text(response)
try:
result = json.loads(response)
except json.JSONDecodeError:
logger.warning(f"LLM response for '{target_language}' is not valid JSON, applying fallback")
result = {
"content": response.strip(),
"suffix": target_language[:2].lower(),
}

result["target_language"] = target_language
return result
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А нет смысла всю эту асинхронную логику куда-то отдельно вынести и при необходимости переиспользовать? Она же вроде не специфична именно для translate-функциоальности?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, в будущем надо будет перенести. Скорее всего в модуль с генерацией readme

@fl1pcoin fl1pcoin merged commit 0ab0931 into main Oct 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Auto-generation of multi-lang README setup

2 participants