<commit_before><?php

namespace UFirst\LangImportExport;

use Lang;

class LangListService {

	public function loadLangList($locale, $group) {
		$translations = Lang::getLoader()->load($locale, $group);
		$translations_with_prefix = array_dot(array($group => $translations));
		return $translations_with_prefix;
	}

	public function writeLangList($locale, $group, $new_translations) {
		$translations = Lang::getLoader()->load($locale, $group);
		foreach($new_translations as $key => $value) {
			array_set($translations, $key, $value);
		}
		$header = "<?php\n\nreturn ";

		$language_file = app_path("resources/lang/{$locale}/{$group}.php");
		if (is_writable($language_file) && ($fp = fopen($language_file, 'w')) !== FALSE) {

			fputs($fp, $header.var_export($translations[$group], TRUE).";\n");
			fclose($fp);
		} else {<commit_msg>resources is in base_path in Laravel 5 (refs #2)<commit_after><?php

namespace UFirst\LangImportExport;

use Lang;

class LangListService {

	public function loadLangList($locale, $group) {
		$translations = Lang::getLoader()->load($locale, $group);
		$translations_with_prefix = array_dot(array($group => $translations));
		return $translations_with_prefix;
	}

	public function writeLangList($locale, $group, $new_translations) {
		$translations = Lang::getLoader()->load($locale, $group);
		foreach($new_translations as $key => $value) {
			array_set($translations, $key, $value);
		}
		$header = "<?php\n\nreturn ";

		$language_file = base_path("resources/lang/{$locale}/{$group}.php");
		if (is_writable($language_file) && ($fp = fopen($language_file, 'w')) !== FALSE) {

			fputs($fp, $header.var_export($translations[$group], TRUE).";\n");
			fclose($fp);
		} else {
{'fraction_non_alphanumeric': 0.1816588785046729, 'fraction_numerical': 0.0011682242990654205, 'mean_word_length': 5.935222672064778, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4256375', 'n_tokens_mistral': 611, 'n_tokens_neox': 567, 'n_words': 106}