public void downloadAndInstallTranslations(List<LanguageInfo> languages, @Nullable Sender sender, boolean updateStatus) {
        TranslationManager manager = this.plugin.getTranslationManager();
        Path translationsDirectory = manager.getRepositoryTranslationsDirectory();

        // clear existing translations
        clearDirectory(translationsDirectory, TranslationManager::isTranslationFile);

        for (LanguageInfo language : languages) {
            if (sender != null) {
                Message.TRANSLATIONS_INSTALLING_SPECIFIC.send(sender, language.locale().toString());
            }

            Request request = new Request.Builder()
                    .header("User-Agent", this.plugin.getBytebin().getUserAgent())
                    .url(TRANSLATIONS_DOWNLOAD_ENDPOINT + language.id())
                    .build();

            Path file = translationsDirectory.resolve(language.locale().toString() + ".properties");

            try (Response response = this.plugin.getBytebin().makeHttpRequest(request)) {
                try (ResponseBody responseBody = response.body()) {
                    if (responseBody == null) {
                        throw new IOException("No response");
                    }

                    try (InputStream inputStream = new LimitedInputStream(responseBody.byteStream(), MAX_BUNDLE_SIZE)) {
                        Files.copy(inputStream, file, StandardCopyOption.REPLACE_EXISTING);
                    }
                }
            } catch (UnsuccessfulRequestException | IOException e) {
                if (sender != null) {
                    Message.TRANSLATIONS_DOWNLOAD_ERROR.send(sender, language.locale().toString());
                    this.plugin.getLogger().warn("Unable to download translations", e);
                }
            }
        }

        if (updateStatus) {
            writeLastRefreshTime();
        }

        manager.reload();
    }
Downloads and installs translations for the given languages.

@param languages the languages to install translations for
@param sender the sender to report progress to
@param updateStatus if the status file should be updated
common/src/main/java/me/lucko/luckperms/common/locale/TranslationRepository.java